Localsolver
6.0
|
LocalSolverBlackBox environment.
Main class of LocalSolverBlackBox library. Here are described the basic steps for using LocalSolverBlackBox:
Note that this API is not thread safe. If multiple threads access and modify a same LocalSolverBlackBox environment, it must be synchronized. The only methods that can be used without synchronization are GetState() and Stop().
Public Member Functions | |
LocalSolverBlackBox () | |
Constructs a complete LocalSolverBlackBox environment and take a token license. | |
void | Dispose () |
Delete the LocalSolverBlackBox objects and release the licence token. | |
LSBBState | GetState () |
Gets the state of this LocalSolverBlackBox environment. | |
LSBBModel | GetModel () |
Gets the model associated to this LocalSolverBlackBox environment. | |
LSBBParam | GetParam () |
Gets the parameters of this LocalSolverBlackBox environment. | |
void | Solve () |
Solves the model. | |
void | Stop () |
Aborts the resolution previously launched using Solve(). | |
LSBBSolution | GetSolution () |
Gets the best solution found by the solver. |
localsolverblackbox.LocalSolverBlackBox.LocalSolverBlackBox | ( | ) |
Constructs a complete LocalSolverBlackBox environment and take a token license.
If no token is available or if the token server is not accessible, an exception is thrown. The token license is released when the destructor of this LocalSolverBlackBox environment is called.
void localsolverblackbox.LocalSolverBlackBox.Dispose | ( | ) |
Delete the LocalSolverBlackBox objects and release the licence token.
This method is automatically called when the LocalSolverBlackBox object was created in a using statement (see IDisposable interface). Otherwise it must be called explicitly. It deletes the native memory used by LocalSolverBlackBox and makes the LocalSolverBlackBox licence available for another LocalSolverBlackBox model.
LSBBState localsolverblackbox.LocalSolverBlackBox.GetState | ( | ) |
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.
LSBBModel localsolverblackbox.LocalSolverBlackBox.GetModel | ( | ) |
Gets the model associated to this LocalSolverBlackBox environment.
Once the model is created and closed, the solver can be launched with LocalSolverBlackBox::Solve().
LSBBParam localsolverblackbox.LocalSolverBlackBox.GetParam | ( | ) |
Gets the parameters of this LocalSolverBlackBox environment.
void localsolverblackbox.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.
void localsolverblackbox.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 state LSBBState::Running.
LSBBSolution localsolverblackbox.LocalSolverBlackBox.GetSolution | ( | ) |
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 or LSBBState::Stopped.