Variable relative solution tolerance in GamsModelInstance Topic is solved

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

Variable relative solution tolerance in GamsModelInstance

Post by Ilya »

I need to solve a model with multiple varying data (thus the use of GamsModelInstance) several times with varying accuracy (start at lower accuracy and progress towards OptCr=0).
As far as I am aware, the OptCr option is set for the GamsCheckpoint from which the GamsModelInstance is created.
Recreating a new GamsModelInstance (with all the Modifiers, instantiation etc.) each time the solution tolerance needs to be tightened seems a bit unwieldy.
Is it possible to directly change these parameters for the existing GamsModelInstance, without re-instantiation?
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Variable relative solution tolerance in GamsModelInstance

Post by bussieck »

You will need to solve the instance with a solver option file that sets the option for relative optimality before the solve method. You can pass a GamsModelInstanceOpt object to the solve method to instruct the solve to process the solver option file (see https://www.gams.com/latest/docs/apis/p ... b9ac9f6bab and https://www.gams.com/latest/docs/apis/p ... ceOpt.html).

-Michael
Post Reply