To avoid the error, you can use a logical condition in the constraint declaration:
con count{i in PLANTS, j in HOUROP: j+1 in HOUROP}:
But you also need to rewrite the IF-THEN logic as a linear constraint. Your desired implication is equivalent to its contrapositive:
/* if use_plant[i,j+1] = 0 then sum{i in PLANTS, j in HOUROP} use_plant[i,j] >= pl_minup[i] */
You can capture this with a big-M constraint:
pl_minup[i] - sum{i in PLANTS, j in HOUROP} use_plant[i,j] <= (pl_minup[i] - 0) * use_plant[i,j+1];
This simplifies to:
sum{i in PLANTS, j in HOUROP} use_plant[i,j] >= pl_minup[i] * (1 - use_plant[i,j+1]);
... View more