Python API: Solving two models one after the other

Questions on using the GAMS APIs (Python, .NET, etc.)
Post Reply
Giorgis
User
User
Posts: 1
Joined: 5 years ago

Python API: Solving two models one after the other

Post by Giorgis »

Hello!

I have a .gms file containing two models and two solve statements. If I just add the .gms file as a string in a naive way, only the first solve statement is executed. However, I cannot seem to find the way to run both solve statements by looking at the Tutorial and the documentation. Could someone direct me in doing this?

Best,
Giorgis
User avatar
Clemens
Posts: 57
Joined: 7 years ago

Re: Python API: Solving two models one after the other

Post by Clemens »

Giorgis,

It would be good if you can provide some code that demonstrates the problem. I assume that you are using GamsWorkspace.add_job_from_string() to create a GamsJob instance. This one can be executed using the run() method and should per default compile and execute all your GAMS code.

Best,
Clemens
Post Reply