Dynamic nodes

Problems with syntax of GAMS
fstone
User
User
Posts: 2
Joined: 2 months ago

Dynamic nodes

Postby fstone » 2 months ago

Hi all, many many thanks in advance for any help you can provide with the following issue:
I have a supply chain network design problem, where all the nodes can be open like plant or like supplier. I make that:

SETS
n nodos /n1*n10/
ni(n) plants //
nj(n) suppliers //

variable
CT COST
Y(nj) binary variable indica if in node n open like plant j
X(ni) binary variable indica if in node n open like supplier i
F(ni,nj,m,t) flow between ni and nj
A(ni,nj,t) binary variable Assigment supplier i to plant j

BINARY VARIABLES
Y(nj)
X(ni)
A(ni,nj,t) ;

positive variable
F(ni,nj,m,t);

EQUATIONS
FO objetive function
EQ1(n) only oe type of facility per nodo
EQ2 limit number of plant
E1(n) Not posible open plant in this nodes
Supply(ni,t) supply limit
ship(ni,nj,t) logic flow
R3(ni,t) only one plant per supplier
R4(nj,t) some supplier per palnt


FO.. CT =e= sum(nj,Y(nj) * CIU * PI) + sum(ni,X(ni) * CIT) ;
EQ1(n).. sum(nj,Y(nj)) + sum(ni,X(ni)) =e= 1 ;
EQ2.. sum(nj,Y(nj)) =e= NY ;
EQ3.. sum(ni, X(ni)) =e= NX ;
E1(n)$(ord(n)le 5).. sum(nj, Y(nj)) =l= 0 ;
E2(n)$(ord(n)gt 5).. sum(ni, X(ni)) =l= 0 ;
supply(ni,t).. sum((nj,m),F(ni,nj,m,t)) =E= QBI(ni,t);
maxship(ni,nj,t).. sum(m,F(ni,nj,m,t))=l= bigM*A(ni,nj,t);
R3(ni,t).. sum(nj,A(ni,nj,t))=e= 1;
R4(nj,T).. sum(ni,A(ni,nj,t))=g= 1;

Who is online

Users browsing this forum: Bing [Bot] and 1 guest