Originally posted by: JCGar
Hello,
Thank you so much, it runs fine. But I tried using the code for a restriction and it doesn't work. I get an error: a type of tuple was expected, but an int was found.
I attached a part of the code:
int nbL = 2;
range H = 1..nbL;
tuple conjPrecedesor{
int h; // line
int i; // task
int taskP; // task predecesor ;
}
{int} conjPred [h in H, i in 1..5] = [ [{} {1} {2} {2} {4}]
[{} {1} {} {} {}] ];
{conjPrecedesor} index_IPhi = { <h,i,taskP> | h in H, i in conjTask[h], taskP in conjPred[h][i] };
subject to {
forall (h in H, u in qh[h], i in conjTask[h] : conjPred[h][i].size == 0 )
ST[<h,u,i>] >= cth[h]* sum(c in qh[h])(c-1) * x[<h,u,c>];
forall (h in H, u in qh[h], i in conjTask[h] : conjSuce[h][i].size == 0 )
ST[<h,u,i>] + item(conjuntoTiempos [h][i],0) <= cth[h] * sum(c in qh[h]) c * x[<h,u,c>];
}
Regards.
#DecisionOptimization#OPLusingCPLEXOptimizer