LocalSolverBlackBoxΒΆ
Object-oriented APIs are provided for C++, allowing a full integration of LocalSolverBlackBox in your C++ 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 LocalSolverBlackBox
environment.
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 LSBBModel::bool,
LSBBModel::call()
, LSBBModel::createNativeFunction()
to
create LSBBExpressions. A LocalSolverBlackBox model is composed of a
O_Call
expression. The first argument of this expression is
an expression of type O_NativeFunction
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 LocalSolverBlackBox::solve()
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
a LSBBParam
class with LocalSolverBlackBox::getParam()
then set the according attributes.
Retrieve the solution
The solution is available throw the method
LocalSolverBlackBox::getSolution()
and carries the values of all
expressions in the model.