Hello everybody, I encountered a problem in my model below. I try to define N(k) as a positive and integer variable but in gams, I can define a variable as one type. How can I define it both positive and integer variable and how can I round up i?
sets
i tum noktalar kumesı /06/
A1(i) baslangıc noktası /0/
A2(i) atık toplama noktaları kumesı /15/
A3(i) bosaltma noktaları kumesı /6/
k cop toplama aracları /1/
Alias (i,j,m);
parameter
table Y(i,j) dügümler arası mesaeler
0 1 2 3 4 5 6
0 999 100 140 100 30 110 60
1 100 999 140 100 30 110 60
2 140 150 999 120 40 100 120
3 100 150 90 999 100 40 20
4 30 120 90 80 999 30 50
5 110 40 100 80 60 999 80
6 60 100 40 30 60 20 999 ;
Parameter
p(i) cop mıktarı /
0 0
1 300
2 700
3 600
4 500
5 500
6 0 /;
Parameter
C arac kapasitesi /1500/;
variables z;
binary variables x(i,j,k);
positive variables N(k);
Equations amac, eq1(i), eq2(k),eq6(k), eq9(k), eq12(k,j);
amac…z=e=sum((k,i,j), x(i,j,k)Y(i,j));
eq1(i)(A2(i))..sum((j,k), x(i,j,k))=e=1;
eq2(k)..sum(j A2(j), x(‘0’,j,k))=e=1;
eq6(k)…sum(j A2(j),(p(j)* sum((i)(ord(i) gt 0),x(i,j,k)))) =l= CN(k);
eq9(k)…sum(m $ A3(m), x(m,‘0’,k)) =e= 1 ;
eq12(k,j)…sum(i, x(i,j,k)) =e= sum(i, x(j,i,k));
model Wastecol1/all/;
Solve Wastecol1 using MIP minimizing z;
display z.l, x.l, N.l;