Hi,
I need to define variables that depend on a variable number k of arguments. For example, I would like to do the following for a generic k
set Y = 1 .. 3;
var P {y1 in Y, y2 in Y, ....., yk in Y};
k ranges from 8 to 200 approx depending on the particular application, so I want to write a model where I just have to set the value of k at the very beginning as a parameter (so I don't have to enter the names of arguments y1, y2,.... yk manually for each application). In addition, I would like to use the "number" associated with an argument to define the objetive function and/or restrictions; for example with k=3
maximize Function: sum {k in Y} sum {y1 in Y, y2 in Y, y3 in Y: yk == k} P[y1,y2,y3]
What is the most efficient way of doing this?
Thanks