dependent set

Problems with modeling
Post Reply
Alchimist
User
User
Posts: 1
Joined: 6 years ago

dependent set

Post by Alchimist »

Hello,

i want to define the set q {a+1,...,a+b(c)} with the set a /1*10/ and the parameter b(c) in GAMS.

How can I correctly formulate the set q in GAMS?

regards
Alchimist
cladelpino
User
User
Posts: 108
Joined: 7 years ago

Re: dependent set

Post by cladelpino »

Simplest approach:

Code: Select all

set a /a1*a10/,q(a);

parameter howMany /4/;

q(a)=YES$(ord(a)<=howMany);

parameter someParameter;

someParameter(q)=1;

display a,q,someParameter;
If for some reason this doesn't fit your scheme, there are other things to do.
Post Reply