gplsol
is most likely complaining about the product of variables doT1 * T1
and doT2 * T2
.
I'm assuming that doT1
and doT2
are binary variables, and T1
and T2
are continuous variables (representing the duration of tasks). (Note that this means you will have to use a mixed integer programming solver rather than a pure linear programming solver. You might also want to try using a powerful MIP solver like Gurobi).
You can construct your model by rewriting your constraints and objective as
minimize T1 + T2 + (additional variables)
st T1 <= UT1*doT1
T2 <= UT2*doT2
doT1 + doT2 <= 1
doT1, doT2 binary
(plus any additional constraints)
where UT1
is an upper bound on the duration of task T1
and UT2
is an upper bound on the duration of task T2
. If doT1 = 0
then T1 <= 0
, so the task will not be completed. If doT1 = 1
, then T1 <= UT1
, meaning that task T1
is allowed to take some duration. The same holds for T2
.
The OR condition is expressed by the constraint doT1 + doT2 <= 1
. This constraint means that doT1
and doT2
cannot both be 1. That is only one job can be selected. Note that the <=
constraint also allows you to not perform either task. If at least one task must be completed, you want to use the constraint doT1 + doT2 == 1
.