This module is a tool to select different optimization engines.
Many of my modules rely on integer linear programming and use
and the like to solve the ILPs. This module makes switching between
different optimization engines easier.
Selecting and using a solver
set_solver function is used to select the optimization package
desired. Without any arguments it selects the
Cbc optimizer. Otherwise,
set_solver(NAME) is used to choose the desired optimizer, e.g.,
set_solver(Gurobi). (For this to work, this must follow
get_solver is a replacement for
with_solver function. Instead of this:
MOD = Model(with_solver(Cbc.Optimizer))
we do this:
MOD = Model(get_solver())
Selecting and using solver options
Solver options can be set up using these functions:
set_solver_options(kwd, val)adds the option whose name is given by the symbol
kwdto be the value
val. To add several options, use this several times.
set_solver_options(d::Dict)adds all the key/value entries in
das options by repeated calls to
clear_solver_options()erases all solver options.
get_solver_options()returns a dictionary of the options that are currently set.
JuMP model is created using
options are passed along.
Note that each call to
get_solver clears all options.
set_solver_verbose() function can be used to tell the solver to
be verbose in its operation. Alternatively,
The action of
set_solver_verbose is through
At present, this function only knows how to do this for the