Resource-contrained CPM

Problems with modeling
Post Reply
Instasergy
User
User
Posts: 3
Joined: 4 years ago

Resource-contrained CPM

Post by Instasergy »

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

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;
User avatar
bussieck
Moderator
Moderator
Posts: 1042
Joined: 7 years ago

Re: Resource-contrained CPM

Post by bussieck »

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
Instasergy
User
User
Posts: 3
Joined: 4 years ago

Re: Resource-contrained CPM

Post by Instasergy »

I tried to update my model.
**** Exec Error at line 15: Equation infeasible due to rhs value

**** INFEASIBLE EQUATIONS ...

Code: Select all

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;
Instasergy
User
User
Posts: 3
Joined: 4 years ago

Re: Resource-contrained CPM

Post by Instasergy »

I tried to update my model , i have this error
**** Exec Error at line 15: Equation infeasible due to rhs value

**** INFEASIBLE EQUATIONS ...

Code: Select all

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;
Post Reply