Xii >= Xij how to code in GAMS

Problems with modeling
Post Reply
lixlz51
User
User
Posts: 11
Joined: 4 months ago
Location: University of Nottingham, UK

Xii >= Xij how to code in GAMS

Post by lixlz51 » 4 months ago

Hi everyone,
I am learning GAMs to solve a NLP model. I want to specify that the local demand is prioritized before the warehouse can be used for stores in other region. so how to express Xii>=Xij in gams? I was trying to use the following

set i 'warehouse' /1*3/;
alias(i,j); *each warehouse is assigned to each local store for replenishment, so the set for warehouse and store is the same

variable
x(i,j) 'warehouse i is used to replenish demand for store j';

eq(warehouse).. X(''i,i'') =ge= X(''i,j'')$i ne j;


how can i correct this to express Xii>=Xij while i is not equal to j? Thank you a million for your help!

Manassaldi
User
User
Posts: 66
Joined: 1 year ago
Location: Rosario - Argentina

Re: Xii >= Xij how to code in GAMS

Post by Manassaldi » 4 months ago

Hi, it's simple

set i warehouse /1*3/;
alias(i,j);

eq(i,j)$(ord(i) ne ord(j)).. X(i,i) =g= X(i,j);


Bye

lixlz51
User
User
Posts: 11
Joined: 4 months ago
Location: University of Nottingham, UK

Re: Xii >= Xij how to code in GAMS

Post by lixlz51 » 4 months ago

Manassaldi wrote:
4 months ago
Hi, it's simple

set i warehouse /1*3/;
alias(i,j);

eq(i,j)$(ord(i) ne ord(j)).. X(i,i) =g= X(i,j);


Bye
Hi Really appreciate your help! Have a good day

Post Reply