Search found 8 matches

by patriciars
2 months ago
Forum: Syntax
Topic: How to store the words in a set?
Replies: 2
Views: 162

Re: How to store the words in a set?

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.
by patriciars
2 months ago
Forum: Syntax
Topic: How to store the words in a set?
Replies: 2
Views: 162

How to store the words in a set?

Hello. For example in the code below: 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...
by patriciars
4 months ago
Forum: API
Topic: GAMS PYTHON API - INTERFACE JUPYTER
Replies: 7
Views: 1152

Re: GAMS PYTHON API - INTERFACE JUPYTER

OK. Thank you. Your idea worked with cases ate leats two dimension(i,j). for rec in t1.out_db["cost"]: print("cost(" + rec.key(0) + "," + rec.key(1) + "): level=" + str(rec.level) + " marginal=" + str(rec.marginal)) And zero dimensional too. rec = t1.out_db["cost"].first_record() print("level=" + st...
by patriciars
4 months ago
Forum: API
Topic: GAMS PYTHON API - INTERFACE JUPYTER
Replies: 7
Views: 1152

Re: GAMS PYTHON API - INTERFACE JUPYTER

Hello Clemens Now, it's work. Thank you. But I have just onde more doubt. When accessing the variable cost of my gams file, the message that appears is: index too large. Below is the gms file I'm using and the code I used to run the spyder. If you can help me I thank you very much, because I am not ...
by patriciars
4 months ago
Forum: API
Topic: GAMS API Python
Replies: 7
Views: 1560

Re: GAMS API Python

Thank you I didt it. And now the error is: GAMS return code not 0 (6), set the debug flag of the GamsWorkspace constructor to DebugLevel.KeepFiles or higher or define a working_directory to receive a listing file with more details So, i puted the debug like this: from __future__ import print_functio...
by patriciars
4 months ago
Forum: API
Topic: GAMS PYTHON API - INTERFACE JUPYTER
Replies: 7
Views: 1152

Re: GAMS PYTHON API - INTERFACE JUPYTER

Hello. Now the problem is code 2 0 compilation. I'm testing gams api pyhton with the TRNSPORT.gms example and ran it right on the spyder. But when I test for another file I created myself (and this file runs correctly on gams.exe), in spyder it gives: gamslib return code not 0 (2) How can I solve th...
by patriciars
4 months ago
Forum: API
Topic: GAMS API Python
Replies: 7
Views: 1560

Re: GAMS API Python

I am having a problem with gams python api. I have a gams file that runs correctly. When I import to use the interface with python through spyder, it gives compilation error: GamsException: gamslib return code not 0 (2) The code in python to run gams: if __name__ == "__main__": if len(sys.argv) > 1:...
by patriciars
4 months ago
Forum: API
Topic: GAMS PYTHON API - INTERFACE JUPYTER
Replies: 7
Views: 1152

GAMS PYTHON API - INTERFACE JUPYTER

Hello. I wrote a file in gams and would like to run in python through the Jupyter interface. But it gives the following error: gamsException: Invalid GAMS system directory: D:\JWP\WinPython-32bit-2.7\notebooks\-f It finds another directory for GAMS and not the one that should be used. (THIS SHOULD B...