x is not properly restricted

Problems with syntax of GAMS
Post Reply
User avatar
zadel88
User
User
Posts: 2
Joined: 6 years ago

x is not properly restricted

Post by zadel88 »

In this problem I need all the "t" x(j,t) to be grouped in secuence, i,e,

x(1,1) sould be a vercor of 1111111000000

BINARY VARIABLE
x, y, z, l, k ;

EQUATIONS
OBJ, R1, R2, R3, R4, R5, R6, R7;

OBJ.. F =E= sum(o,sum(w,n(o,w)*y(o,w)));
R1(o).. sum(w,(y(o,w))) =E= 1;
R2(j).. sum(t,x(j,t)) =E= p(j);
R3.. (x(j,t) = min(x(j,t)) and (x(j,t)=1);
R4(t,w) $(ord(t) gt 0 $(ord(t) lt 601 $(ord(w) eq 1))).. sum(j,x(j,t)) =L= sum(o,(y(o,w)))*10;
R5(t,w) $(ord(t) gt 481 $(ord(t) lt 961 $(ord(w) eq 2))).. sum(j,x(j,t)) =L= sum(o,(y(o,w)))*30;
R6(t,w) $(ord(t) gt 120 $(ord(t) lt 661 $(ord(w) eq 3))).. sum(j,x(j,t)) =L= sum(o,(y(o,w)))*25;
R7(t,w) $(ord(t) gt 960 $(ord(t) lt 1441 $(ord(w) eq 4))).. sum(j,x(j,t)) =L= sum(o,(y(o,w)))*15;
MODEL LINEAL /OBJ, R1, R2, R3, R4, R5, R6, R7 /;
SOLVE LINEAL USING MIP MINIMIZING F;

Insted I'm getting this (all blanc spaces are zeroes)

http://imgur.com/a/cOVD0


How can I restrict the x variable in a way that the sum((j,t) is a answers an continuous vercor?
Post Reply