Configuring a solver
The Xpress executable used by the example above is contained in the Xpress distribution. For other solvers please follow these steps:
- Download a solver executable working with the NL format
- for example: http://ampl.com/products/solvers/open-source
- Make sure the solver executable is on the PATH
- for example, same location as amplxpress[.exe]
(bin subdirectory of Xpress installation) - alternatively, specify NL_SOLVERPATH
- for example, same location as amplxpress[.exe]
- Configure your model to use the solver:
- NL_SOLVER always needs to be set
- use NL_SOLVERPATH if
- the solver executable is not on the path, or
- the executable name is different from the solver prefix in NL_SOLVER, or
- the executable requires additional options (define a batch script)
- optional: define specific solver settings in NL_OPTIONS
Here are some configuration examples for nlsolv controls under Windows:
- Xpress Optimizer (LP, MIP, QCQP)
setparam("NL_SOLVER", "xpress") setparam("NL_SOLVERPATH", "amplxpress.exe")
- Knitro (requires a separate license, NLP)
setparam("NL_SOLVER", "knitro") setparam("NL_SOLVERPATH", "knitroampl.exe")
- Cplex (requires a separate license, LP, MIP, QCQP)
setparam("NL_SOLVER", "cplex") setparam("NL_SOLVERPATH", "cplexamp.exe")
- ipopt (NLP)
setparam("NL_SOLVER", "ipopt")
- cbc (NLP)
setparam("NL_SOLVER", "cbc") setparam("NL_SOLVERPATH", "cbc.bat") ! Contents: cbc %3 -AMPL
© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.