ampl / amplpy

Python API for AMPL

Home Page:https://amplpy.ampl.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fail to choose a different solver - always using 'minos'

rfigueiredo2022 opened this issue · comments

Hi!

I am using python 3.10.2, and I'm using amplpy to run a model in AMPL using a free solver (e.g. 'bonmin').
To do that, I've tried to choose the solver with:

if argc > 1:
        ampl.set_option('solver','bonmin')

However, it gives an error saying that 'minos' is not available for my AMPL license. So, to confirm which solver is being actually used, I use the following code right after the previous:

value = ampl.get_option('solver')
if value is not None:
       print('Option solver exists and has value:', value)

And it returns: 'Option solver exists and has value: minos', confirming that 'minos' is still being considered.
Why doesn't amplpy update the solver I'm choosing instead of keeping 'minos'?
Anyone else has had this problem?

Thank you!