LocalSolverBlackBox Class¶
-
class
LocalSolverBlackBox
¶ This class contains the LocalSolverBlackBox environment. It is the main class of the LocalSolverBlackBox library. Here are described the basic steps for using LocalSolverBlackBox:
- Build your model
LSBBModel
by creating some expressionsLSBBExpression
. - If desired, parameterize and add phases to the solver
LSBBParam
. - Run the solver
LocalSolverBlackBox
. - Retrieve the best solution found by the solver
LSBBSolution
.
Please consult
LSVersion
for copyright and version info.- Build your model
Summary¶
get_state |
Gets the state of this LocalSolverBlackBox environment. |
get_model |
Gets the model associated to this LocalSolverBlackBox environment. |
get_param |
Gets the parameters of this LocalSolverBlackBox environment. |
solve |
Solves the model. |
stop |
Aborts the resolution previously launched using solve(). |
get_solution |
Gets the best solution found by the solver. |
Instance methods¶
-
LocalSolverBlackBox.
get_state
()¶ Gets the state of this LocalSolverBlackBox environment. This method can be called in any state. In particular, this method can be called in state
LSBBState.RUNNING
.Returns: State of LocalSolverBlackBox. Return type: LSBBState
-
LocalSolverBlackBox.
get_model
()¶ Gets the model associated to this LocalSolverBlackBox environment. Once the model is created and closed, the solver can be launched with
solve()
.Returns: Model Return type: LSBBModel
-
LocalSolverBlackBox.
get_param
()¶ Gets the parameters of this LocalSolverBlackBox environment.
Returns: Parameters Return type: LSBBParam
-
LocalSolverBlackBox.
solve
()¶ Solves the model. This method returns only when the time limit or the evaluation limit are reached. The model must be closed to launch the resolution.
-
LocalSolverBlackBox.
stop
()¶ Aborts the resolution previously launched using
solve()
. If no resolution was launched, this method does nothing. Called from another thread, this method enables users to stop the resolution properly. Solution remains valid. This method can be called in any state, notably in stateLSBBState.RUNNING
.
-
LocalSolverBlackBox.
get_solution
()¶ Gets the best solution found by the solver. If the solver has not been started at least once, all the decision variables of the solution are set to 0 (such a solution may be infeasible). Only allowed in states
LSBBState.PAUSED
orLSBBState.STOPPED
.Returns: The best solution. Return type: LSBBSolution