public class LSSolution
extends java.lang.Object
LSSolutionStatus
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the solution and set all decisions to zero.
|
boolean |
equals(java.lang.Object obj) |
LSArray |
getArrayValue(LSExpression expr)
Gets the value of this expression in the best solution found by the solver.
|
LSCollection |
getCollectionValue(LSExpression expr)
Returns the value of the given expression in this solution.
|
double |
getDoubleObjectiveBound(int objectiveIndex)
Returns the bound computed by the solver for the given objective.
|
double |
getDoubleValue(LSExpression expr)
Returns the value of the given expression in this solution.
|
long |
getIntObjectiveBound(int objectiveIndex)
Returns the bound computed by the solver for the given objective.
|
long |
getIntValue(LSExpression expr)
Returns the value of the given expression in this solution.
|
LocalSolver |
getLocalSolver()
Returns the LocalSolver object associated to this solution.
|
long |
getObjectiveBound(int objectiveIndex)
Returns the bound computed by the solver for the given objective.
|
LSSolutionStatus |
getStatus()
Returns the status of the solution.
|
long |
getValue(LSExpression expr)
Returns the value of the given expression in this solution.
|
int |
hashCode() |
boolean |
isUndefined(LSExpression expr)
Returns true if the given expression has an undefined value in this solution.
|
boolean |
isViolated(LSExpression expr)
Returns true if the given expression is violated in this solution.
|
void |
setDoubleValue(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 |
setValue(LSExpression expr,
double value)
Sets the value of the given expression in this solution.
|
void |
setValue(LSExpression expr,
long value)
Sets the value of the given expression in this solution.
|
public LocalSolver getLocalSolver()
public void setValue(LSExpression expr, long value)
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(localsolver.LSExpression, long)
.expr
- Decision.value
- Value assigned to the decision in this solution.LSExpression.isDecision()
,
LSExpression.isInt()
,
LSExpression.isBool()
public void setValue(LSExpression expr, double value)
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(localsolver.LSExpression, double)
.expr
- Decision.value
- Value assigned to the decision in this solution.LSExpression.isDecision()
,
LSExpression.isDouble()
public void setIntValue(LSExpression expr, long value)
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()
public void setDoubleValue(LSExpression expr, double value)
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()
public long getValue(LSExpression expr)
LSState.Paused
or LSState.Stopped
. Only allowed
if this expression is an integer or a boolean. This method has the same
behavior as getIntValue(LSExpression)
.expr
- Expression.LSExpression.isInt()
,
LSExpression.isBool()
public double getDoubleValue(LSExpression expr)
LSState.Paused
or LSState.Stopped
. Only allowed
if this expression is a double.expr
- Expression.LSExpression.isDouble()
public long getIntValue(LSExpression expr)
LSState.Paused
or LSState.Stopped
. Only allowed
if this expression is an integer or a boolean.expr
- Expression.LSExpression.isInt()
,
LSExpression.isBool()
public LSCollection getCollectionValue(LSExpression expr)
LSState.Paused
or LSState.Stopped
. Only allowed
if this expression is a collection (list or set).
This method is a shortcut for getCollectionValue(localsolver.LSExpression)
.expr
- Expression.LSExpression.isCollection()
public LSArray getArrayValue(LSExpression expr)
LSState.Paused
or LSState.Stopped
.
Only allowed if this expression is an array.
This method is a shortcut for getArrayValue(localsolver.LSExpression)
.LSExpression.isArray()
public boolean isViolated(LSExpression expr)
LSState.Paused
or LSState.Stopped
.expr
- Expression.public boolean isUndefined(LSExpression expr)
LSState.Paused
or LSState.Stopped
.expr
- Expression.public LSSolutionStatus getStatus()
LSState.Paused
or LSState.Stopped
.LSSolutionStatus
public long getObjectiveBound(int objectiveIndex)
LSState.Paused
or LSState.Stopped
.
Only allowed if this expression is an integer or a boolean. This method
has the same behavior as getIntObjectiveBound(int)
.objectiveIndex
- Index of the objective.LSExpression.isInt()
,
LSExpression.isBool()
public long getIntObjectiveBound(int objectiveIndex)
LSState.Paused
or LSState.Stopped
.
Only allowed if this expression is an integer or a boolean.objectiveIndex
- Index of the objective.LSExpression.isInt()
,
LSExpression.isBool()
public double getDoubleObjectiveBound(int objectiveIndex)
LSState.Paused
or LSState.Stopped
.
Only allowed if this expression is a double.objectiveIndex
- Index of the objective.LSExpression.isDouble()
public void clear()
LSState.Stopped
.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object