Originally posted by: Tentons
Hello,
I'm trying to do a very simple scheduling program. Having N workers and M jobs with certain lengths and worker requirements.
I want to see each worker's schedule.
using CP;
int Workers = 6;
int Jobs = 10;
tuple Job {
int duration;
int workforce;
}
Job JobList[1..Jobs] = [<4, 5>, <6, 3>, <5, 2>, <6, 1>, <2, 2>, <4 , 3>, <5, 2>, <9, 2>, <8, 5>, <3, 6>];
dvar interval schedule[j in 1..Jobs] size JobList[j].duration;
dvar interval assignment[1..Jobs][1..Workers] optional;
dvar sequence workerSchedule[w in 1..Workers] in all (j in 1..Jobs) assignment[j][w];
cumulFunction working = sum (j in 1..Jobs) pulse(schedule[j], JobList[t].workforce);
minimize max (j in 1..Jobs) endOf(schedule[j]);
subject to {
working <= Workers;
forall (j in 1..Jobs)
alternative(schedule[j],
all (w in 1..Workers) assignment[j][w]),
JobList[j].workforce);
forall (w in 1..Workers)
noOverlap(workerSchedule[w]);
}
The resulting schedule is correct. However the resulting assignment is quite glitched when I open it in Data View. First in the tableView only first few lines are filled, rest is blank. Then in the Gantt chart of assignment one of the worker's job is completelly off, shifted than it is in schedule. As it's shown in picture (above Gantt is for assignment, bottom one is for schedule).
What causes this misalignment? Thank you.

#DecisionOptimization#OPLusingCPOptimizer