If both an environment variable and its corresponding CLI flag are defined, the CLI flag will overwrite the environment variable.
These are the default options that are available with MIP.
Valid time units for -solve.duration
are as follows, according to time.ParseDuration
from Go's standard library:
ns
(nanoseconds)us/µs
(microseconds)ms
(milliseconds)s
(seconds)m
(minutes)h
(hours)
The solve duration is displayed in ns
in the output.
The options are marshalled to the output when running an app, under the options
key. Here is an example of how the options are displayed.
Solver control parameters
Please find relevant links and examples for each provider in the supported solvers page.
The Nextmv SDK has options for controlling the solver that work regardless of the provider being used. Some of these options include (using CLI-style flags):
-solve.duration
: maximum duration of the solve.-solve.verbosity
: verbosity of the solver.-solve.mip.gap.relative
: relative gap for the MIP solver.-solve.mip.gap.absolute
: absolute gap for the MIP solver.
Each provider has its own set of parameters for controlling the solver. Depending on the option's data type, you can use one of the following flags (the list showcases CLI-style flags) to set these parameters:
-solve.control.bool
: parameters withbool
values.-solve.control.float
: parameters withfloat
values.-solve.control.int
: parameters withint
values.-solve.control.string
parameters withstring
values.
Each of these options receives a name=value
pair. To set multiple options of the same type, use a comma-separated list: name1=value1,name2=value2
. Note that not all providers support all data types.
Here is an example where out-of-the-box SDK options are set, alongside HiGHS
-specific options. The Nextmv CLI is used. Notice that some options set multiple solver parameters.
Given that verbosity is set to high
, the console will show the solver's log (exposing that the options were set):
The output also shows the options that were used: