Hello everybody,
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
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;
There are a couple and compilation errors and equation op makes no sense whatsoever because it does not contain any variable. Try to make a better case.
-Michael
I tried to update my model.
**** Exec Error at line 15: Equation infeasible due to rhs value
**** INFEASIBLE EQUATIONS …
SETS att/A*I/;
SETS t/0*20/;
ALIAS (att,i,j);
SET prec(i,j)/ A.B,B.C,D.E,E.F,H.F, G.H, H.I/;
PARAMETERS durata(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(att,i),resource(t) ;
tempo(i).. time =g= s(i) + durata(i);
precedenza(prec(i,j)).. s(i) + durata(i) =l= s(j);
resource(t)..sum(i,operatori(i)) =l= par;
MODEL schedule /all/;
SOLVE schedule USING lp MINIMIZING time;
DISPLAY time.l, s.l;
I tried to update my model , i have this error
**** Exec Error at line 15: Equation infeasible due to rhs value
**** INFEASIBLE EQUATIONS …
SETS att/A*I/;
SETS t/0*20/;
ALIAS (att,i,j);
SET prec(i,j)/ A.B,B.C,D.E,E.F,H.F, G.H, H.I/;
PARAMETERS durata(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(att,i),resource(t) ;
tempo(i).. time =g= s(i) + durata(i);
precedenza(prec(i,j)).. s(i) + durata(i) =l= s(j);
resource(t)..sum(i,operatori(i)) =l= par;
MODEL schedule /all/;
SOLVE schedule USING lp MINIMIZING time;
DISPLAY time.l, s.l;