Originally posted by: SystemAdmin
[phlab said:]
Just an additional remark, if possible, it may be more efficient to avoid the definition of new additional decision variables. For instance:
- if you only want to specify an earliest available time earliestStart[m] for a machine m, it will be better to just constrain the start time of each tasks:
forall(m in Machines, i in Tasks) earliestStart[m] <= startOf(tasks[i][m], earliestStart[m]);<br />
If interval variable tasks[i ][m] is optional, you must make sure the constraint is satisfied when the interval is absent, that's why a value "earliestStart[m]" is specified in the startOf expression.
- if you want to use the "sequence end" in the cost function, it is better to directly use the integer expression. For instance (assuming you want to minimize the sum of the machines end time):
dexpr int machineEnd[m in Machines] = max(i in Tasks) endOf(tasks[i][m]);
minimize sum(m in Machines) machineEnd[m];
Philippe
#DecisionOptimization#OPLusingCPOptimizer