Defining a dynamic set in GAMS, General Algebraic Modeling System

Viewed 66

I want to define a dynamic set in GAMS, General Algebraic Modeling System. For example, consider the next line:

Set i "Customers" /1*100/;

Sometimes it will be /1x50/ and sometimes /1x100/. For this aim, I wrote something like /1*I/ where I will be a parameter that will be defined later, but it is not accepted. What can I do about it?

1 Answers

You can do this:

Set i "All Customers" /1*100/
    iAct(i) "Active Customers";

iAct(i)$(ord(i)<=50) = yes;
Display iAct;

iAct(i)$(ord(i)<=75) = yes;
Display iAct;
Related