Localsolver
6.0
|
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 | |
LocalSolver | GetLocalSolver () |
Returns the LocalSolver object associated to this solution. | |
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. | |
IEnumerable< LSExpression > | GetViolatedExpressions () |
Returns the collection of violated expressions in this solution. | |
LSSolutionStatus | GetStatus () |
Returns the status of the solution. | |
void | Clear () |
Clear the solution and set all decisions to zero. |
LocalSolver localsolver.LSSolution.GetLocalSolver | ( | ) |
Returns the LocalSolver object associated to this solution.
void localsolver.LSSolution.SetValue | ( | LSExpression | expr, |
long | value | ||
) |
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 LSSolution::SetIntValue.
expr | Decision. |
value | Value assigned to the decision in this solution. |
void localsolver.LSSolution.SetValue | ( | LSExpression | expr, |
double | value | ||
) |
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 LSSolution::SetDoubleValue.
expr | Decision. |
value | Value assigned to the decision in this solution. |
void localsolver.LSSolution.SetIntValue | ( | LSExpression | expr, |
long | value | ||
) |
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. |
Since version 3.0
void localsolver.LSSolution.SetDoubleValue | ( | LSExpression | expr, |
double | value | ||
) |
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. |
Since version 3.0
long localsolver.LSSolution.GetValue | ( | LSExpression | expr | ) |
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. |
double localsolver.LSSolution.GetDoubleValue | ( | LSExpression | expr | ) |
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. |
Since version 3.0
long localsolver.LSSolution.GetIntValue | ( | LSExpression | expr | ) |
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. |
Since version 3.0
LSCollection localsolver.LSSolution.GetCollectionValue | ( | LSExpression | expr | ) |
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. |
Since version 5.5
bool localsolver.LSSolution.IsViolated | ( | LSExpression | expr | ) |
Returns true if the given expression is violated in this solution.
An expression can be violated in 3 cases:
Only allowed in states LSState::Paused or LSState::Stopped.
expr | Expression. |
Since version 5.5
IEnumerable<LSExpression> localsolver.LSSolution.GetViolatedExpressions | ( | ) |
Returns the collection of violated expressions in this solution.
LSSolutionStatus localsolver.LSSolution.GetStatus | ( | ) |
Returns the status of the solution.
Only allowed in states LSState::Paused or LSState::Stopped.
void localsolver.LSSolution.Clear | ( | ) |
Clear the solution and set all decisions to zero.
Only allowed in state LSState::Stopped.