Domain violation for set HELP PLEASE

Problems with syntax of GAMS
Post Reply
alic411
User
User
Posts: 1
Joined: 6 years ago

Domain violation for set HELP PLEASE

Post by alic411 »

Hi, I have this code but it says domain violation for set, could someone tell me why? or how do I write the sum x (i, i) that appears in the image thank you very much
sets i assigned station located in the sector /a,b,c,d,e/
j response times in minutes fires in the sector /f,g,h,i,j/;
parameter fe(j) frecuency for emergency (for day)
/
f 2
g 1
h 3
i 1
j 3/;
table a(i,j) average response time to a fire

f g h i j
a 5 12 30 20 15
b 20 4 15 10 25
c 15 20 6 15 12
d 25 15 25 4 10
e 10 25 15 12 5;
binary variable x(i,j) if tract j is assigned to station located in tract i zero in otherwise;
free variable z variable for funtion objective;
equations
funobj objetive funtion response time
rtype1(j) restriction type 1
rtype2(i) restriction type 2
rtype3(i,j) restriction type 3;

funobj.. z=e= sum((i,j),a(i,j)*fe(j));
rtype1(j).. sum(i, x(i,i))=e= 2;
rtype2(i).. sum(j, x(i,j))=e= 1;
rtype3(i,j).. x(i,j)=l=x(i,i);
model example /all/;
solve example minimizing z using MIP;
Attachments
oper.png
Post Reply