I'm a beginner in lp in Gams. I'm struggling for a model of reource-contrained CPM. It seems like the output ignore the resource-contrained equation.
Here is my model
Code: Select all
SETS att/A*I/;
ALIAS (att,i,j);
SET prec(i,j)/ A.B,B.C,D.E,E.F,H.F, G.H, H.I/;
*duration of activies , operatori = contrained resource
PARAMETERS duration(att)/A 7, B 5,C 2, D 3, E 2, F 1, G 4, H 6,I 3/,operatori(att)/A 3,B 2,C 4 ,D 6,E 5,F 1,G 3,H 5,I 2/;
SCALAR par/7/;
FREE VARIABLE time;
NONNEGATIVE VARIABLE s(i);
EQUATIONS tempo(i), precedenza(i,j),op(i) ;
tempo(i).. time =g= s(i) + durata(i);
precedenza(prec(i,j)).. s(i) + durata(i) =l= s(j);
op(i)..sum(i,operatori(i) =l= par;
MODEL schedule /all/;
SOLVE schedule USING lp MINIMIZING time;
DISPLAY time.l, s.l;