Uncontrolled set error 149 and 170

Problems with modeling
Post Reply
mjijena
User
User
Posts: 1
Joined: 6 months ago

Uncontrolled set error 149 and 170

Post by mjijena » 6 months ago

Greetings everyone i being trying to solve the following modelation problem of warehouses instalation point covering the demand, but it keeps giving me error in uncontrolled sets, it is supose that each set represent one coordinate on the x and y axis so it can calculate via the manhattan rule the distance between warehouses and the demand points. here is the model and if any of you could help with the structure.

SETS
i demanda en i /1*10/
j demanda en j /1*10/
x bodega en x /1,4,5/
y bodega en y /1,6,7/


TABLE K(x,y) max storage in warehouse on x y
1 4 5
1 10 0 0
6 0 20 0
7 0 0 22
TABLE M(x,y) cost of instalation in warehouse on x y
1 4 5
1 1000 0 0
6 0 2200 0
7 0 0 3000


TABLE Da(i,j) demand on the point i j

1 2 3 4 5 6 7 8 9 10

1 4,2 9,8 7,5 7,3 5,8 5,1 3,6 3,1 1,3 8,1

2 5,1 0,8 9,4 6,6 2,5 1,6 5,8 6,3 0,1 8,7

3 0,6 2,5 1,6 2,2 3,3 8,4 1,5 0,8 0,3 6,4

4 5,9 8,7 7,7 4 0,8 2,5 6,6 7,2 6,2 9,5

5 9,4 2 0,7 0,1 4,3 1,9 3,9 2,5 3,7 5,4

6 5,2 6,7 8,3 3,7 0,4 8,7 9,2 0,9 3,4 1,9

7 3,3 9,7 1,4 1,3 2,8 7,8 9,8 0,3 3,4 2,7

8 6,7 0,7 4,6 7 2,8 0,1 8,7 3 6,9 4,7

9 7,9 4,8 1,4 9,3 3,7 4,9 1,9 2,7 9,8 4,1

10 3,8 8,6 4,4 5,4 1,1 8,8 5,9 8 1,6 2,4



BINARY VARIABLE

A(x,y) if warehouse in x y is build ;

POSITIVE VARIABLE

B(x,y,i,j) transported from warehouse in x y to demand in i j;

EQUATIONS ONJ, R1, R2, R3;

OBJ.. Z=e= SUM[(i,j,x,y), 0.001*1*Da(i,j)* [ABS(x-i)+ ABS(y-j)]*B(y-j)]+ SUM[(x,y),M(x,y)*A(x,y)] ;
R1.. SUM [(x,y),B(x,y,i,j)] =g= Da(i,j);
R2.. SUM [(i,j), B(x,y,i,j)] =l= K(x,y)*A(x,y) ;

MODEL LINEAL /OBJ, R1, R2/;
SOLVE LINEAL USING LP MINIMIZING Z;

User avatar
Renger
Posts: 221
Joined: 2 years ago

Re: Uncontrolled set error 149 and 170

Post by Renger » 6 months ago

Hi
You have an equation R1 and R2 that sums a four-dimensional variable over 2 of its dimensions. You have to tell Gams what you want to do with the remaining two. I assume that you want to have the equation over these two dimensions:
R1(i,j)
R2(i,j)
Try to search for the error message in this forum. THis question has often be answered.


By the way, if you want to provide code, please put in between the code tags (the "</>" in the menu bar if you write a post. The formatting will then be preserved. Now people have to reformat your tables.

Cheers
Renger

Post Reply