Hello all,
I have diffuculties to code the equation in the image attached, I will appreciate if someone can help me.
My sets are:
I set of nodes
K set of all transportation modes
T set of time units
Alias (i, j, h)
Alias (k, m)
Parameter
𝛕ijk travel time(hour) from node i to node j with mode k
y and Iy are decision variables.
How to code a complex indexed variable in Gams?
Re: How to code a complex indexed variable in Gams?
I don't understand which variable you are referring to but you can add multiple indices to a variable
In your case
should work since you have defined alias.
While defining summation, you have to index equation with i and the summation operator with some alias. For example,
- Atharv
In your case
Code: Select all
variable
y(i, i, k, t)
Iy(i, k, t)
;
While defining summation, you have to index equation with i and the summation operator with some alias. For example,
Code: Select all
constraint(i).. sum(h,...)