Originally posted by: MatthGond
Hello,
I have a problem in which I have to schedule some operation (or activities). Each operation Oi has a date date_op(Oi) before that it is preferable to start Oi.
I would minimize the number of operations which start after their respective date_op.
For example, operation O1 can be run between 10 and 500, has a duration of 50 and its date_op = 200 (which mean I would prefer run O1 before 200 than after).
I use IloNoOverlap and I would also count the number of operation scheduled before their date_op.
I do not know how get the starting time fiwed by the constraint IloNoOverlap of the operations.
I try to write a constraint like : model.add(IloIfThen(env, St[i].??? <date, Theta[i]==1)).
A short piece of my code --------------
IloBoolVarArray Theta(env, nb_Tache); // Theta[i]=1 if the operation i starts before date[i]
for (int i = 0; i < nb_Tache; i++)
{ Theta[i] = IloBoolVar(env);}
IloIntArray tp(env, nb_Tache );
IloTransitionDistance distance(env, nb_Tache );
IloIntervalVarArray St(env, nb_Tache) ; // All operations can start between 0 and 500.
IloIntervalSequenceVar operation(env, St, tp);
model.add(IloNoOverlap(env, operation, distance, IloTrue));
for (int i = 0; i < nb_Tache; i++)
{
int date=my_data.date_op[i]; // I want to know if operation i starts before "date_op" which is a data of my problem
model.add(IloIfThen(env, St[i].??? <date, Theta[i]==1));
// I would know the starting time of St[i] given by the constraint IloNoOverlap
}
---------------------------------
thank you very much for your help
Matth
#CPOptimizer#DecisionOptimization