how to dynamically update a set

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

how to dynamically update a set

Postby yanzhiping » 2 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: 31
Joined: 3 months ago

Re: how to dynamically update a set

Postby cladelpino » 2 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