Hello friends,
I have three sets and one variable and one equation of the form below:
set m /m1, m2, m3/;
set i /i1, i2/
set C(m,i) / m1.i1, m2.i2/;
set XR /1*10/;
P_X0(m, i, XR);
Equation eq1(m,i);
eq1(m,i) $(C(m,i)).. P_X0(m,i, o(m,i) ) = 1;
In the Gams code above, there is one thing not defined, namely o(m,i)
, I want to know how I can define o(m,i)
to be a subset of XR
. There come two possible options, I think:
- Defining
o(m,i)
to be a parameter, i.e.
parameter o(m,i) /m1.i1 3, m2.i2 10/;
However, this is not good , because 1 is not a string!
2. Defining o(m,i)
as some kind of function from C to XR, mapping each (m,i) to ‘3’ or '10. I just don’t know how and what the syntax for it might be!
I would very much appreciate it if you could help me find a resolution.
Regards,
Amir