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, long value) |
Sets the value of the given expression in this solution. | |
void | SetValue (LSExpression expr, double value) |
Sets the value of the given expression in this solution. | |
void | SetIntValue (LSExpression expr, long value) |
Sets the value of the given expression in this solution. | |
void | SetDoubleValue (LSExpression expr, double value) |
Sets the value of the given expression in this solution. | |
long | GetValue (LSExpression expr) |
Returns the value of the given expression in this solution. | |
double | GetDoubleValue (LSExpression expr) |
Returns the value of the given expression in this solution. | |
long | GetIntValue (LSExpression expr) |
Returns the value of the given expression in this solution. | |
LSCollection | GetCollectionValue (LSExpression expr) |
Returns the value of the given expression in this solution. | |
bool | IsViolated (LSExpression expr) |
Returns true if the given expression is violated in this solution. | |
LSSolutionStatus | GetStatus () |
Returns the status of the solution. | |
void | Clear () |
Clear the solution and set all decisions to zero. |
Properties | |
IEnumerable< LSExpression > | ViolatedExpressions [get] |
Returns the collection of violated expressions in this solution. |
|
inline |
Sets the value of the given expression in this solution.
Only decisions can be set. Only allowed in state LSState.Paused or LSState.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. |
LSExpression.IsDecision LSExpression.IsInt LSExpression.IsBool
|
inline |
Sets the value of the given expression in this solution.
Only decisions can be set. Only allowed in state LSState.Paused or LSState.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 LSState.Paused or LSState.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. |
LSExpression.IsDecision LSExpression.IsInt Since version 3.0
|
inline |
Sets the value of the given expression in this solution.
Only decisions can be set. Only allowed in state LSState.Paused or LSState.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. |
LSExpression.IsDecision LSExpression.IsDouble Since version 3.0
|
inline |
Returns the value of the given expression in this solution.
Only allowed in states LSState.Paused or LSState.Stopped. Only allowed if this expression is an integer or a boolean.
expr | Expression. |
|
inline |
Returns the value of the given expression in this solution.
Only allowed in states LSState.Paused or LSState.Stopped. Only allowed if this expression is a double.
expr | Expression. |
LSExpression.IsDouble Since version 3.0
|
inline |
Returns the value of the given expression in this solution.
Only allowed in states LSState.Paused or LSState.Stopped. Only allowed if this expression is an integer or a boolean.
expr | Expression. |
LSExpression.IsInt LSExpression.IsBool Since version 3.0
|
inline |
Returns the value of the given expression in this solution.
Only allowed in states LSState.Paused or LSState.Stopped. Only allowed if this expression is an collection (list).
expr | Expression. |
LSExpression.IsCollection Since version 5.5
|
inline |
Returns true if the given expression is violated in this solution.
An expression can be violated in 3 cases:
expr | Expression. |
Since version 5.5
|
inline |
Returns the status of the solution.
Only allowed in states LSState.Paused or LSState.Stopped.
|
inline |
Clear the solution and set all decisions to zero.
Only allowed in state LSState.Stopped.
|
get |
Returns the collection of violated expressions in this solution.