## i am very new to gams and started using this software just yesterday. i tried writing a code for a scheduling problem but there seem to be way too many errors. i however am not able to rectify these errors. it would be of tremendous help if anyone could go through the code mentioned below and help me rectify the errors. thank you

Sets T tasks / i1*i5 /*

U Units / j1j5 /

N event points / z0,z1,z2,z3,z4 /

S State / y1,y2,y3,y4,y5,y6/

allow(T,U) allowable allocations / i1.j1, i2.j2, i3.j3, i4.j4, i5.j5 /;

Parameter Vmin(T,U) Minimum values

/i1.j1 100

i2.j2 100

i3.j3 50

i4.j4 100

i5.j5 200/;

Parameter Vmax(T,U) Maximum values

/i1.j1 300

i2.j2 200

i3.j3 150

i4.j4 300

i5.j5 400/;

Parameter STmax(S) Maximum storage pertaining to state

/y1 1000

y2 1000

y3 1000

y4 1000

y5 1000/;

Parameter r(S) market requirement pertaining to state

/y1 0

y2 0

y3 0

y4 0

y5 100/;

Parameter produ(S,T) produced at state s

/y2.i1 0

y3.i2 0

y4.i3 0

y5.i4 0

y6.i5 0/;

Parameter consum(S,T) produced at state s

/y2.i1 0

y3.i2 0

y4.i3 0

y5.i4 0

y6.i5 0/;

Parameter a(T,U) constant processing time

/i1.j1 2

i2.j2 4

i3.j3 5

i4.j4 3

i5.j5 4/;

Parameter H time horizon

/12/;

Parameter cl(T,U) constant cleaning time

/i1.j1 3

i2.j2 2

i3.j3 4

i4.j4 8

i5.j5 4/;

Parameter vc(T,U) variable cleaning time

/i1.j1 .1

i2.j2 .1

i3.j3 .1

i4.j4 .1

i5.j5 .1/;

Variable

I objective function value

Binary Variables

bt(T,N) Beginning of task t at event point n

bu(U,N) Beginning of unit U at event point n

bc(U,N) Beginning of cleaning for a unit if product is different;

Positive Variables

B(T,U,N) amount of material undertaking task t at unit u at event point n

d(S,N) Amount of state S to be delivered at event point n

ST(S,N) Amount of state s produced at event point n

TS(T,U,N) Time of start of task t in unit U at event point n

TF(T,U,N) Time of Finish of task t in unit U at event point n;

Equations

milpobj nlp subproblems objective

alloc(U) allocating units to tasks

capac(T,U) to ensure that capacity is within limits

stor(S) to ensure produced is less than equal to the storage capacity

balance(S,N) Material Balance

Demand(S,N) to ensure produced is more than equal to demand

dur(T,U,N) to ensure start of task is only after finish of previous

seq1(T,U,N) same task in same unit

seq2(T,U,N) same task in same unit

seq3(T,U,N) same task in same unit

seq4(T,U,N) different task in same unit

seq5(T,U,N) different task in different unit

time1(T,U,N) time horizon constraint one

time2(T,U,N) time horizon constraint two ;

milpobj … I =e= sum(N,(Ts (T(‘ord(T+1)’), U(‘ord(U+1)’), N(‘ord(N+1)’)) - Tf (T, U, N)) );//to esure the next task in the next unit in next event point starts onlyafter finish of previous

alloc(U) … sum(I,bt(T,N)) =e= bu(U,N);

capac(T,U) … (Vmin*bt(T,N)) =g= B(T,U,N) =l= (Vmax*bt(T,N));

stor(S,N) … ST(S,N) =g= STmax(S,N);

balance(S,N) … ST(S,N) =e= ST(S,N-1)-d(S,N)+(sum(T,produ(S,T))*sum(U,B(T,U,N-1)))+(sum(T,consum(S,T))**sum(U,B(T,U,N)));*

Demand(S,N) … sum(N,d(S,N)) =g= r(S);

dur(T,U,N) … TF(T,U,N) =e= TS(T,U,N)+(a(T,U)*bt(T,N))+(cl(T,U)* bc(U,N))+(vc(T,U)(cl(T,U) bc(U,N)));

seq1(T,U,N) … TS(T,U,‘ord(N+1)’) =g= TF(T,U,N)-H(2-bt(T,N)-bu(U,N));///to compare the start time of next event point and current one

seq2(T,U,N) … TS(T,U,‘ord(N+1)’) =g= TS(T,U,N);

seq3(T,U,N) … TF(T,U,‘ord(N+1)’) =g= TF(T,U,N);

seq4(T,U,N) … TS(T,U,‘ord(N+1)’) =g= TF(T,U,N)-H(2-bt(‘ord(T+1)’,N)-bu(U,N));

seq5(T,U,N) … TS(T,U,‘ord(N+1)’) =g= TF(‘ord(T+1)’,‘ord(U+1)’,N)-H(2-bt(‘ord(T+1)’,N)-bu(‘ord(U+1)’,N));

time1(T,U,N) … TF(T,U,N) =l= H;

time2(T,U,N) … Ts(T,U,N) =l= H;

model catmix /all/;

solve catmix minimizing obj using CPLEX12;

\

U Units / j1

*sum(U,B(T,U,N)));*

Demand(S,N) … sum(N,d(S,N)) =g= r(S);

dur(T,U,N) … TF(T,U,N) =e= TS(T,U,N)+(a(T,U)(cl(T,U)

Demand(S,N) … sum(N,d(S,N)) =g= r(S);

dur(T,U,N) … TF(T,U,N) =e= TS(T,U,N)+(a(T,U)

*bt(T,N))+(cl(T,U)*bc(U,N))+(vc(T,U)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?hl=en.

For more options, visit https://groups.google.com/groups/opt_out.

\