RCPSP problem

hello
please help me too solve this problem

sets
i /i1,i2,i3,i4/
m /m1,m2/
q /q1,q2/
z /z1,z2/
t /0*22/
h /h1,h2/;
alias (i,j);
alias (t,b);
set
path(i,j) /
i1.i2
i1.i3
i2.i4
i3.i4 /;

parameters
d(i,m,q) /
i1.m1.q1 10
i1.m1.q2 11
i1.m2.q1 7
i2.m1.q1 10
i2.m1.q2 11
i2.m2.q1 7
i3.m1.q1 5
i3.m1.q2 6
i3.m2.q1 3
i4.m1.q1 8
i4.m1.q2 9
i4.m2.q1 6/
r(i,m,q) /
i1.m1.q1 2
i1.m1.q2 3
i1.m2.q1 4
i2.m1.q1 3
i2.m1.q2 4
i2.m2.q1 5
i3.m1.q1 5
i3.m1.q2 6
i3.m2.q1 7
i4.m1.q1 7
i4.m1.q2 8
i4.m2.q1 9/
c(i,m,q)/
i1.m1.q1 1
i1.m1.q2 2
i1.m2.q1 3
i2.m1.q1 1
i2.m1.q2 2
i2.m2.q1 3
i3.m1.q1 1
i3.m1.q2 2
i3.m2.q1 3
i4.m1.q1 1
i4.m1.q2 2
i4.m2.q1 3/
f(i,h) /
i1.h1 200
i1.h2 300
i2.h1 300
i2.h2 350
i3.h1 100
i3.h2 200
i4.h1 150
i4.h2 200/
l(q) /
q1 5
q2 6/
ch(h) /
h1 10
h2 12/
cs(z,h) /
z1.h1 20
z1.h2 40
z2.h1 18
z2.h2 42/
cap(z,h)/
z1.h1 2000
z1.h2 2000
z2.h1 3000
z2.h2 3000/
es(i) /
i1 0
i2 8
i3 8
i4 16 /
ls(i) /
i1 0
i2 8
i3 12
i4 16/;
variables
x(i,m,q,t)
s(z,h,t)
is(h,t)
zz1
zz2
zz3;
binary variable x;
integer variables
S
IS;
free variables
zz1
zz2
zz3;
equation
time
cost1
cost2
mode1(i)
pre(i,j)
human(t,q)
material(t,h)
capa(t,h,z);

time … zz1=e=sum(i,sum(m,sum(q,sum(t$((ord(t)=es(i))),x(i,m,q,t)*ord(t)))));
cost1 … zz2=e=sum(i,sum(m,sum(q,sum(t,x(i,m,q,t)*d(i,m,q)*c(i,m,q)))));
cost2 … zz3=e=sum(z,sum(h,sum(t,cs(z,h)*s(z,h,t))))+sum(z,sum(h,sum(t,is(h,t)*ch(h)))) ;
mode1(i) … sum(m,sum(q,sum(t$((ord(t)=es(i))),x(i,m,q,t))))=e=1 ;
pre(i,j)path(i,j) .. sum(m,sum(q,sum(t,x(i,m,q,t)*(ord(t)+d(i,m,q)))))=l=sum(m,sum(q,sum(t,x(j,m,q,t)*ord(t)))); human(t,q) .. sum(i,sum(m,sum(b[(ord(b)=ord(t)-d(i,m,q)+1)],r(i,m,q)*x(i,m,q,b))))=l=l(q);
material(t,h) … is(h,t)=g=is(h,t-1)+sum(z,s(z,h,t))-sum(i,sum(m,sum(q,sum(b$[(ord(b)=ord(t)-d(i,m,q)+1)],f(i,h)*x(i,m,q,b)))));
capa(t,h,z) … s(z,h,t)=l=cap(z,h) ;

model untitled_6 /all/;
solve untitled_6 using mip minimizing zz1;
display zz1.l,zz2.l,zz3.l,x.l,s.l,is.l;

this model Iike example Plain solution but Wayne Example instabilmente realisticnot Crown modell I left our concept














\

Untitled_10.gms (6.4 KB)

Hi Mani!

Your syntax is correct (perhaps not what you wanted to write) but you
are having trouble at run time.

If you check equation mode1(i), in the sum over t one of the two
conditions you specify for it to happen is ord(t) wrote:

hello
please help me too solve this problem

sets
i /i1,i2,i3,i4/
m /m1,m2/
q /q1,q2/
z /z1,z2/
t /0*22/
h /h1,h2/;
alias (i,j);
alias (t,b);
set
path(i,j) /
i1.i2
i1.i3
i2.i4
i3.i4 /;

parameters
d(i,m,q) /
i1.m1.q1 10
i1.m1.q2 11
i1.m2.q1 7
i2.m1.q1 10
i2.m1.q2 11
i2.m2.q1 7
i3.m1.q1 5
i3.m1.q2 6
i3.m2.q1 3
i4.m1.q1 8
i4.m1.q2 9
i4.m2.q1 6/
r(i,m,q) /
i1.m1.q1 2
i1.m1.q2 3
i1.m2.q1 4
i2.m1.q1 3
i2.m1.q2 4
i2.m2.q1 5
i3.m1.q1 5
i3.m1.q2 6
i3.m2.q1 7
i4.m1.q1 7
i4.m1.q2 8
i4.m2.q1 9/
c(i,m,q)/
i1.m1.q1 1
i1.m1.q2 2
i1.m2.q1 3
i2.m1.q1 1
i2.m1.q2 2
i2.m2.q1 3
i3.m1.q1 1
i3.m1.q2 2
i3.m2.q1 3
i4.m1.q1 1
i4.m1.q2 2
i4.m2.q1 3/
f(i,h) /
i1.h1 200
i1.h2 300
i2.h1 300
i2.h2 350
i3.h1 100
i3.h2 200
i4.h1 150
i4.h2 200/
l(q) /
q1 5
q2 6/
ch(h) /
h1 10
h2 12/
cs(z,h) /
z1.h1 20
z1.h2 40
z2.h1 18
z2.h2 42/
cap(z,h)/
z1.h1 2000
z1.h2 2000
z2.h1 3000
z2.h2 3000/
es(i) /
i1 0
i2 8
i3 8
i4 16 /
ls(i) /
i1 0
i2 8
i3 12
i4 16/;
variables
x(i,m,q,t)
s(z,h,t)
is(h,t)
zz1
zz2
zz3;
binary variable x;
integer variables
S
IS;
free variables
zz1
zz2
zz3;
equation
time
cost1
cost2
mode1(i)
pre(i,j)
human(t,q)
material(t,h)
capa(t,h,z);

time …
zz1=e=sum(i,sum(m,sum(q,sum(t$((ord(t)=es(i))),x(i,m,q,t)*ord(t)))));
cost1 … zz2=e=sum(i,sum(m,sum(q,sum(t,x(i,m,q,t)*d(i,m,q)*c(i,m,q)))));
cost2 …
zz3=e=sum(z,sum(h,sum(t,cs(z,h)*s(z,h,t))))+sum(z,sum(h,sum(t,is(h,t)*ch(h))))
;
mode1(i) …
sum(m,sum(q,sum(t$((ord(t)=es(i))),x(i,m,q,t))))=e=1 ;
pre(i,j)path(i,j) .. sum(m,sum(q,sum(t,x(i,m,q,t)*(ord(t)+d(i,m,q)))))=l=sum(m,sum(q,sum(t,x(j,m,q,t)*ord(t)))); human(t,q) .. sum(i,sum(m,sum(b[(ord(b)=ord(t)-d(i,m,q)+1)],r(i,m,q)*x(i,m,q,b))))=l=l(q);
material(t,h) …
is(h,t)=g=is(h,t-1)+sum(z,s(z,h,t))-sum(i,sum(m,sum(q,sum(b$[(ord(b)=ord(t)-d(i,m,q)+1)],f(i,h)*x(i,m,q,b)))));
capa(t,h,z) … s(z,h,t)=l=cap(z,h) ;

model untitled_6 /all/;
solve untitled_6 using mip minimizing zz1;
display zz1.l,zz2.l,zz3.l,x.l,s.l,is.l;

this model Iike example Plain solution but Wayne Example instabilmente
realisticnot Crown modell I left our concept


“gamsworld” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\