How can I connect two indexs (i1,i2) and then put it in GAMS coding? Topic is solved

Problems with modeling
Post Reply
Agustino
User
User
Posts: 7
Joined: 1 year ago

How can I connect two indexs (i1,i2) and then put it in GAMS coding?

Post by Agustino »

:D
Last edited by Agustino 1 year ago, edited 4 times in total.
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: How can I connect two indexs (i1,i2) and then put it in GAMS coding?

Post by bussieck »

1) Use an alias (https://www.gams.com/latest/docs/UG_Set ... mesForASet): alias (i,i1,i2). Declare everything with i and use it in the algebra as needed.
2) Use not sameas(i1,i2) (https://www.gams.com/latest/docs/UG_Con ... eywdSameas) in a $ condition (https://www.gams.com/latest/docs/UG_Con ... rCondition): sum((j,i1,i2)$(not sameas(i1,i2)), ...)

-Michael
Post Reply