Originally posted by: SystemAdmin
[phlab said:]
Dear Deborah,
For modeling your problem in OPL/CPO, you will have to create one optional interval variable [tt]tasksOnMachine[i ][k][/tt] for each possible allocation of a given task i to one of the 'K' machines. And then, you will create an alternative constraint between [tt]task[i ][/tt] and all possible allocations [tt]tasksOnMachine[i ][k][/tt] of this task i on the K machines.
The OPL formulation looks like this:
dvar interval tasks[i in 1..n] size p;
dvar interval tasksOnMachines[i in 1..n][k in 1..K] optional;
dvar sequence machines[k in 1..K] in all(i in 1..n) tasksOnMachines[i][k];
constraints {
forall(i in 1..n)
alternative(tasks[i], all(k in 1..K) tasksOnMachines[i][k]);
forall(k in 1..K)
noOverlap(machines[k]);
};
Hope it helps,
Philippe
#DecisionOptimization#OPLusingCPOptimizer