Hi, I need to solve this project but im a lil stuck.
It should be something like this, but i cant get the gams code perfect.
$title EASY EAT
SETS
i 'orders'/o1,o2,o3,o4,o5,o6,o7,o8/
j 'riders'/r1,r2,r3,r4,r5,r6/;
ALIAS(i,i2);
ALIAS(j,j2);
PARAMETERS
p(i) 'order preparation time [min]'
/o1 7,o2 10,o3 2,o4 15,o5 5,o6 20,o7 5,o8 15/
o(j) 'orders delivered by rider j'
/r1 5,r2 5,r3 7,r4 4,r5 6,r6 8/
SCALARS
L 'distance tax [€-km]'/10/
Zt 'delay tax [€-minute]'/1/
Wt 'waiting tax [€-minute]'/0.3/;
TABLE
W(j,i) 'minutes of waiting from rider j in order i[min]'
o1 o2 o3 o4 o5 o6 o7 o8
r1 2.8 4.5 0 9.7 0 11.1 0 8.6
r2 0 4 0 8.7 0 16.1 1.3 9.6
r3 0.5 4.9 0 11.6 0.2 16.5 1.4 9.5
r4 0 2.9 0 9.5 0 14.6 0 7.5
r5 1.3 4.4 0 12 2.9 16.2 0.4 8.7
r6 1.1 7.4 0 9.8 0 13.8 0.3 12.5
;
TABLE
Z(j,i) 'minutes of delay from rider j in order i[min]'
o1 o2 o3 o4 o5 o6 o7 o8
r1 0 0 8 0 0.3 0 2.9 0
r2 1.9 0 3 0 1.3 0 0 0
r3 0 0 2.5 0 0 0 0 0
r4 1.6 0 4.5 0 0.5 0 0.5 0
r5 0 0 1.6 0 0 0 0 0
r6 0 0 5.8 0 0.2 0 0 0
;
TABLE
d(j,i) 'distance used by rider j-k to pick i up [km]'
o1 o2 o3 o4 o5 o6 o7 o8
r1 0.7 1.5 4.2 2 3 3.5 2.9 2
r2 4.7 3 2.4 3.2 1.7 0.9 1 2.6
r3 2.7 1.9 1.5 0.8 1.7 0.9 1 2.1
r4 2.8 1.9 1.5 0.9 1.7 0.8 0.9 2.1
r5 2.8 2.8 1.6 1.2 0.7 1.7 2.2 3.2
r6 2.3 4 3.5 1.9 3.3 2.5 1.6 0.3 ;
TABLE
t(j,i) 'time used by rider j-k to pick i up [min]'
o1 o2 o3 o4 o5 o6 o7 o8
r1 4.2 5.5 10 5.3 8 8.9 7.9 6.4
r2 8.9 6 5 6.3 7.7 3.9 3.7 5.4
r3 6.5 5.1 4.5 3.4 4.8 3.5 3.6 5.5
r4 8.6 7.1 6.5 5.5 6.9 5.4 5.5 7.5
r5 5.7 5.6 3.6 3 2.1 3.8 4.6 6.3
r6 5.9 2.6 7.8 5.2 7.5 6.2 4.7 2.5 ;
VARIABLES
X(i,j) 'indicator of choosing j rider for order i'
OFV 'objective function value'
MINO 'minimo'
MAXO 'maximo'
BINARY VARIABLE X;
equations
OF 'objective function'
C11(i) 'constraint 11'
C12(j) 'constraint 12'
C2 'constraint 2'
C31(j) 'constraint 31'
C32(j) 'constraint 32'
C33 'constraint 33'
C4(j,i) 'constraint 4';
OF..OFV=E=sum((i,j),X(i,j)*d(j,i)*L)+sum((i,j),X(i,j)*Z(j,i)*Zt)+sum((i,j),X(i,j)*W(j,i)*Wt);
C11(i)..sum(j,X(i,j))=L=1;
C12(j)..sum(i,X(i,j))=L=1;
C2..sum((i,j),X(i,j))=E=min(card(i),card(j));
C31(j)..MAXO=G=(o(j)+sum(i,X(i,j)));
C32(j)..MINO=L=(o(j)+sum(i,X(i,j))+1);
C33..MAXO=L=2*MINO;
C4(j,i) $(Z(j,i)>10)..
sum((i2,j2)$Z(j2,i2)e=0,X(i,j))=G=(min(card(i),card(j))/2)-((min(card(i),card(j))/2)*(1-X(i,j));
MODEL EASYEAT/all/;
SOLVE MODEL EASYEAT MINIMIZING OFV USING MIP;
HOPE SOMEONE COULD HELP TOMORROW IS THE DEADLINE!