Download Using COIN-OR Solvers with Microsoft Windows

Transcript
OSSolverService.exe is its flexibility. Using this executable gives the user access to any of the
above solvers with an instance in MPS, nl, or OSiL format. In addition, the OSSolverService.exe
returns the solver solution in the OSrL XML format which is easily parsed. We now illustrate
several calls to the OSSolverService.exe. Open a command window and change into the bin
directory. Then execute the following in order to solve an instance (in this case a linear program)
in OSiL format:
OSSolverService -osil ../../data/osilFiles/parincLinear.osil
The following illustrates solving an instance in AMPL nl format:
OSSolverService -nl ../../data/amplFiles/parinc.nl
Likewise, to solve a problem in mps format:
OSSolverService -mps ../../data/mpsFiles/parinc.mps
The result is printed to standard output in OSrL format. For example, the values of the primal
variables are expressed as:
<values numberOfVar="2">
<var idx="0">539.9999999999999</var>
<var idx="1">252.0000000000001</var>
</values>
And the the objective function value is expressed as
<objectives>
<values>
<obj idx="-1">7667.941722450357</obj>
</values>
</objectives>
You can also print the result to a file by using the osrl option. This is done as follows:
OSSolverService -osil ../../data/osilFiles/parincLinear.osil
-osrl result.xml
A call to OSSolverService.exe uses the Cbc solver as a default. In order to specify another
solver, use the solver option to specify the solver you want. For example, to solve a model instance
with SYMPHONY type
OSSolverService -osil ../../data/osilFiles/p0033.osil
-solver symphony
To solve a nonlinear model with Bonmin type
OSSolverService -osil ../../data/osilFiles/bonminEx1.osil
-solver bonmin
The name of the solver should always be given in all lower case. It is possible to build the
OSSolverService to work with solvers other than the ones listed in Section 3, but they are not
included due to licensing issues. Specifically, OSSolverServices has also been linked to these solvers:
3