Hello everyone,

I am pretty new to GAMS so i have a lot of problems doing my homework about assembly lines. I couldnt find where the problem is in my code stated below. Thanks for your help. Wish you healty days!

sets

j tasks /Task1*Task11/
i jobs /1*11/

k stations /1*8/

parameter Ear(i) /1 1, 2 1, 3 1, 4 2, 5 1, 6 2, 7 3, 8 2, 9 3, 10 4, 11 6/ ;

parameter Lat(i) /1 4, 2 5, 3 5, 4 6, 5 8, 6 7, 7 6, 8 7, 9 7, 10 7, 11 8/ ;

Variable

z;

Binary Variable x(i,k), y(k);

Table p(i,j) ‘precedence matrix’

Task1 Task2 Task3 Task4 Task5 Task6 Task7 Task8 Task9 Task10 Task11

1 0 1 1 0 0 0 0 0 0 0

2 0 1 1 0 0 0 0 0 0

3 0 0 1 1 0 0 0 0

4 0 0 1 0 0 0 0

5 0 0 0 0 0 1

6 0 1 0 0 0

7 0 1 0 0

8 0 0 1

9 1 0

10 1

11 ;

equations

obj

ass

precedence

cycle;

obj… sum(k, y(k)) =e= z;

ass… sum(i, sum(k (Ord(k)<=Lat(i) and Ord(k)>=Ear(i)), x(i, k))) =e= 1;
precedence.. sum(i,<big>k,</big> k*x(i,k)-sum(j,k ((p(i,j)=1) and Ord(k)<=Lat(j) and Ord(k)>=Ear(j)), k*x(j,k)))=l=0

Model hw2 / all /;

solve hw2 using lp minimizing z;

The problem is with the “k” in big letter. I get the errors 148, 8, 653, 37 and 409.