I am trying to solve an MINLP problem with the ANTIGONE solver (licensed in GAMS), and I am having difficulties to change the advanced settings of the solver.
First, I call the solver from Pyomo as follows.
solver = pe.SolverFactory('gams')
solver.options['mtype']= "minlp"
solution = solver.solve(model, solver = 'antigone')
This part works as it should, however ANTIGONE cannot close the optimality gap, so I'd like to change some of the more advanced options that are provided here https://www.gams.com/latest/docs/S_ANTIGONE.html.
So what I first tried was to change the solver call to the following line.
solution = solver.solve(model, solver='antigone', add_options=['option number_of_partitions 2;'])
However, it looks like add_options
is only for the built-in GAMS options, and not for the solver-specific ones.
As a side note, when using these advanced solver options in GAMS, the standard procedure is to create an options file (i.e. antigone.opt
), where we specify the desired options.
number_of_partitions 2
antigone.opt
is saved under the same directory, and the .gms
file calls this file with the GAMS_MODEL.optfile;
line.
Going back to my issue, when modifying this option from Pyomo, I tried
solution = solver.solve(model, solver='antigone', add_options=['GAMS_MODEL.optfile;'])
but the problem is that Pyomo creates a temporary file to solve the problem, and hence I cannot add the file antigone.opt
before it starts solving.
Therefore, I can see two options to go: (i) I can find a way to create the antigone.opt
file in the temporary file through Pyomo before the solver starts solving (less desirable, but it should work), or (ii) I should directly change the option from Pyomo (preferred).
Any help would be much appreciated and thanks in advance for your time!