Page 1 of 1

dependent set

Posted: Fri Aug 04, 2017 4:21 pm
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

Re: dependent set

Posted: Tue Aug 15, 2017 9:24 pm
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.