1

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?

Aydin
  • 167
  • 1
  • 7

1 Answers1

1

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;
Lutz
  • 2,197
  • 1
  • 10
  • 12