Localsolver
5.5
|
Solution to the optimization model.
A solution carries the values of all expressions in the model. It is used to retrieve the values of all expressions (getting the solution), or to set the values of some decisions (setting the solution).
Public Member Functions | |
void | setValue (LSExpression expr, lsint value) |
Sets the value of the given expression in this solution. | |
void | setValue (LSExpression expr, lsdouble value) |
Sets the value of the given expression in this solution. | |
void | setIntValue (LSExpression expr, lsint value) |
Sets the value of the given expression in this solution. | |
void | setDoubleValue (LSExpression expr, lsdouble value) |
Sets the value of the given expression in this solution. | |
lsint | getValue (const LSExpression expr) |
Returns the value of the given expression in this solution. | |
lsdouble | getDoubleValue (const LSExpression expr) |
Returns the value of the given expression in this solution. | |
bool | isViolated (const LSExpression expr) |
Returns true if the given expression is violated in this solution. | |
lsint | getIntValue (const LSExpression expr) |
Returns the value of the given expression in this solution. | |
LSCollection | getCollectionValue (const LSExpression expr) |
Returns the value of the given expression in this solution. | |
LSSolutionStatus | getStatus () |
Returns the status of the solution. | |
void | clear () |
Clear the solution and set all decisions to zero. | |
~LSSolution () | |
LSSolution () | |
LSSolution (const LSSolution &other) | |
LSSolution & | operator= (const LSSolution &other) |
|
inline |
|
inline |
|
inline |
|
inline |
Sets the value of the given expression in this solution.
Only decisions can be set. Only allowed in state S_Paused or S_Stopped. Only allowed if this expression is an integer or a boolean. If the solver was not launched, this value will be used as an initial value for the decision. This method has the same behavior as setIntValue.
expr | Decision. |
value | Value assigned to the decision in this solution. |
|
inline |
Sets the value of the given expression in this solution.
Only decisions can be set. Only allowed in state S_Paused or S_Stopped. Only allowed if this expression is a double. If the solver was not launched, this value will be used as an initial value for the decision. This method has the same behavior as setDoubleValue.
expr | Decision. |
value | Value assigned to the decision in this solution. |
|
inline |
Sets the value of the given expression in this solution.
Only decisions can be set. Only allowed in state S_Paused or S_Stopped. Only allowed if this expression is an integer or a boolean. If the solver was not launched, this value will be used as an initial value for the decision.
expr | Decision. |
value | Value assigned to the decision in this solution. |
|
inline |
Sets the value of the given expression in this solution.
Only decisions can be set. Only allowed in state S_Paused or S_Stopped. If the solver was not launched, this value will be used as an initial value for the decision. Only allowed if this expression is a double.
expr | Decision. |
value | Value assigned to the decision in this solution. |
|
inline |
|
inline |
Returns the value of the given expression in this solution.
Only allowed in states S_Paused or S_Stopped. Only allowed if this expression is a double.
expr | Expression. |
|
inline |
Returns true if the given expression is violated in this solution.
An expression can be violated in 3 cases:
expr | Expression. |
|
inline |
|
inline |
Returns the value of the given expression in this solution.
Only allowed in states S_Paused or S_Stopped. Only allowed if this expression is an collection (list).
expr | Expression. |
|
inline |
Returns the status of the solution.
Only allowed in states S_Paused or S_Stopped.
|
inline |
Clear the solution and set all decisions to zero.
Only allowed in state S_Stopped.
|
inline |