Object-oriented APIs are provided for Python 2.7, 3.5 or 3.6, allowing a full integration of LocalSolverBlackBox in your Python business applications. LocalSolverBlackBox’s APIs are lightweight, with only a few classes to manipulate. Remind that LocalSolverBlackBox is a model & run math programming solver: having instantiated the model, no additional code has to be written in order to run the solver.
Build your model
First, you have to create a
It is the main class of the LocalSolverBlackBox library. Then, use the
methods of the class
LSBBModel to build your model with
expressions. Expressions are a particularly important concept in
LocalSolverBlackBox. In fact, every aspect of a model is an expression:
variables and objective are
LSBBExpression. You can use the
available shortcut methods like
to create LSBBExpressions. A LocalSolverBlackBox model is composed of a
CALL expression. The first argument of this
expression is an expression of type
NATIVE_FUNCTION and other arguments are decisions
variables that will be passed as arguments to the native function.
Solve your model
Once you have created your model, you have to close it with
LSBBModel.close() and call
to launch the resolution. By default, the search will continue until an
optimal solution is found. To set a time limit or an evaluation limit create
LSBBParam class with
then set the according attributes.
Retrieve the solution
The solution is available throw the method
LocalSolverBlackBox.get_solution() and carries the values of all
expressions in the model.