Set labels based on another

Problems with syntax of GAMS
Post Reply
cladelpino
User
User
Posts: 95
Joined: 1 year ago

Set labels based on another

Post by cladelpino » 6 months ago

Hi all, I am facing a situation with model structure which I don't know what would be an elegant way to solve.

In a prior version of a model I have a symbol which has dimension three: aSymbol(*,*,*)

But now I want to use this symbol projected over a fourth set. aSymbol(aSet,*,*,*). This is of course impossible in GAMS (symbols can only have one amount of dimensions). The motivation to use the same symbol comes from not having to extend downstream processing to this new model case.

A possible workaround is to declare a new set, with the same cardinality of aSet and a unique letter identifier...

Code: Select all

aSet /.../
$eval nElem card(aSet)
aNewSet /e1*e%nElem%/

anEquation(aNewSet,aSet, ... , ... )$(ord(aSet)=ord(aNewSet))..   aSymbol(aNewSet,...,...)=e=...  
1. Is there another possible way I'm missing ?
2. If not, is there anyway I could at least use the aSet labels to construct the aNewSet labels ?

Thanks in advance
Claudio

Post Reply