how to update a set

Problems with syntax of GAMS
Post Reply
cladelpino
User
User
Posts: 108
Joined: 7 years ago

Re: how to update a set

Post by cladelpino »

I adapted the text at https://www.gams.com/latest/docs/usergu ... Complement to your sets

"The membership of B4 is set equal to all those in Bi but not in B0. The operation above is equivalent to the following longer way of representation,

B4(Bi)=yes; B4(B0)=no;"

Key part is "all those in Bi". That definition says nothing about those elements you have removed from Bi, and since you have added them to B4 before, they will remain there.

Easy way out:

Postpone B4 assignment

If that is undesirable:

Reset B4:

B4(B)=NO;
B4(Bi)=not B0(Bi);
Post Reply