public final class DoubleSolution extends java.lang.Object implements Solution<java.lang.Double>
Solution optimized for a single double number.
Modifier and Type | Field and Description |
---|---|
private double |
evaluation |
private static long |
serialVersionUID |
private double |
value |
Constructor and Description |
---|
DoubleSolution(double value) |
DoubleSolution(double value,
double evaluation) |
Modifier and Type | Method and Description |
---|---|
DoubleSolution |
cloneWithNewValue(java.lang.Double newValue) |
double |
evaluationValue()
Returns the fitness of this solution.
|
java.lang.String |
toString() |
java.lang.Double |
unwrap()
Returns the real value of this solution.
|
double |
value() |
DoubleSolution |
withEvaluation(double evaluation)
Updates the evaluation of this solution.
|
private static final long serialVersionUID
private final double value
private final double evaluation
public DoubleSolution(double value, double evaluation)
public DoubleSolution(double value)
public double value()
public double evaluationValue()
Solution
Returns the fitness of this solution. If the fitness was not computed, the returned value will be Double#NaN
.
evaluationValue
in interface Solution<java.lang.Double>
public DoubleSolution withEvaluation(double evaluation)
Solution
Updates the evaluation of this solution.
This function returns a new instance.
withEvaluation
in interface Solution<java.lang.Double>
evaluation
- new evaluation valuepublic java.lang.Double unwrap()
Solution
Returns the real value of this solution.
public DoubleSolution cloneWithNewValue(java.lang.Double newValue)
cloneWithNewValue
in interface Solution<java.lang.Double>
public java.lang.String toString()
toString
in class java.lang.Object