I have a String Parameter with index domain “i” called “ModPrefix” containing prefixes of modules within my project. Each of this modules has a variable with the name “Q”. Now, I would like to access these variables within the definition of a Node called “FacilityNode” like
NetOutflow = ModPrefix(i)::Q
However, this leads to the error
The identifier "Q" has not been declared, but it is declared in the modules [...].
where I replaced the names of the modules with “[...]”.
My idea of a workaround was an if-then-else-statement like
if ( ModPrefix(i) = "prefix1" ) then
elseif ( ModPrefix(i) = "prefix2" ) then
in the case of two modules with prefixes “prefix1” and “prefix2”. However, I would still like to know if there is a way to circumvent it-then-else-statements, since they become ugly in the case of many modules.
Best answer by Chris KuipView original