Hi,
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 d...].
where I replaced the names of the modules with “h...]”.
My idea of a workaround was an if-then-else-statement like
NetOutflow =
if ( ModPrefix(i) = "prefix1" ) then
prefix1:Q
elseif ( ModPrefix(i) = "prefix2" ) then
prefix2:Q
else
0
endif;
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.