how to dynamically update a set

Problems with syntax of GAMS
yanzhiping
User
User
Posts: 63
Joined: 4 months ago

how to dynamically update a set

Postby yanzhiping » 4 months ago

See below, how can I dynamically change set B? B is originally empty.

set A, B
parameter C(A);
loop(A,
if (C(A)>0,
**put A to set B
);
);

cladelpino
User
User
Posts: 40
Joined: 5 months ago

Re: how to dynamically update a set

Postby cladelpino » 4 months ago

This is GAMS code to accomplish that:

sets A,B(A);
parameter C(A);

B(A)=YES$(C(A)>0);


Return to “Syntax”

Who is online

Users browsing this forum: No registered users and 1 guest