How to store the words in a set?

Problems with syntax of GAMS
Post Reply
patriciars
User
User
Posts: 10
Joined: 5 years ago

How to store the words in a set?

Post by patriciars »

Hello.

For example in the code below:

Code: Select all

 Sets
           i source /REF/
          j demand /NHT1, NHT2, NHT3,LNIS, GHT/
          k purifiers /PSA1/;
I need to store the strings REF in set i, the strings NHT1, NHT2, NHT3,LNIS, GHT in set j and teh string PSA1 in set k.

How can I do this?

I need to get the words of each set because I need to make a matrix and this names are the columns.

Thank you for the help.
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: How to store the words in a set?

Post by Renger »

Hi

I have the feeling that you might want to dig in the documentation on GAMS a little more (but I can be wrong).
What do you mean by storing? In an excel or text file? You can just save the sets to an excel file (see the documentation on gdxxrw). You could also read those "words" from an Excel sheet with a table.
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
patriciars
User
User
Posts: 10
Joined: 5 years ago

Re: How to store the words in a set?

Post by patriciars »

Sorry, I forgot To write.
I’m working with Python.. using the gams api python.
I need To import the strings of the set. maybe create a vector with this words, something like this.
Post Reply