Originally posted by: Petr Vilím
Hello,
I assume that you're using OPL since you mention data files.
It is hard to give you exact advice without knowing more of your model. However I recommend to have a look at the OPL examples in directory opl/examples/opl, most likely one of the examples contains something similar to what you need. My guess is something like this in the .mod file:
using CP;
tuple Task {
int start; // Minimum start time
int end; // Maximum end time
int duration;
};
{Task} Tasks = ...;
dvar interval itvs[t in Tasks] in t.start..t.end size t.duration;
And in the data file:
Tasks = {
< 1, 10, 2 >,
< 5, 20, 5 >,
< 7, 30, 1 >
};
Best regards, Petr
#ConstraintProgramming-General#DecisionOptimization