How to change default solver in AMPL?

AMPL uses MINOS by default. I have to enter the "./lpsolve" option; every time I want to use lpsolve as my solver. Is there a way to change the default value?

+4
source share
1 answer

Create a text file in the AMPL and lpsolve directory with the following line:

option solver './lpsolve';

Before running ampl, you must set the OPTIONS_IN environment OPTIONS_IN and point to this newly created text file. I use bash and I gave the name settings.txt to this text file. Before calling ampl, I issue the following command in the bash shell:

export OPTIONS_IN=./settings.txt

There are other ways to do this, and you can use a different shell, so I don't want to extend it.

You can find the helpful CPLEX User Guide . Although there are several gain sections for CPLEX that are commonly used.

For example, all of the above that I am writing is given in this user guide, see chapter 4, “Setting AMPL,” section “Constant Parameter Parameters”.

+2
source

Source: https://habr.com/ru/post/1493842/


All Articles