|
OptaPlanner core 6.0.0.CR3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.optaplanner.core.api.score.AbstractScore<SimpleDoubleScore>
org.optaplanner.core.api.score.buildin.simpledouble.SimpleDoubleScore
public final class SimpleDoubleScore
This Score
is based on 1 level of double constraints.
System.out.println((0.01 + 0.05) == (0.01 + 0.02 + 0.03));
Use SimpleBigDecimalScore
to avoid such problems.
This class is immutable.
Score
,
Serialized FormMethod Summary | |
---|---|
SimpleDoubleScore |
add(SimpleDoubleScore augment)
Returns a Score whose value is (this + augment). |
int |
compareTo(SimpleDoubleScore other)
|
SimpleDoubleScore |
divide(double divisor)
Returns a Score whose value is (this / divisor). |
boolean |
equals(Object o)
|
double |
getScore()
The total of the broken negative constraints and fulfilled positive hard constraints. |
int |
hashCode()
|
SimpleDoubleScore |
multiply(double multiplicand)
Returns a Score whose value is (this * multiplicand). |
static SimpleDoubleScore |
parseScore(String scoreString)
|
SimpleDoubleScore |
power(double exponent)
Returns a Score whose value is (this ^ exponent). |
SimpleDoubleScore |
subtract(SimpleDoubleScore subtrahend)
Returns a Score whose value is (this - subtrahend). |
Number[] |
toLevelNumbers()
Returns an array of doubles representing the Score. |
String |
toString()
|
static SimpleDoubleScore |
valueOf(double score)
|
Methods inherited from class org.optaplanner.core.api.score.AbstractScore |
---|
buildScorePattern, buildScorePattern, parseLevelStrings, parseLevelStrings |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static SimpleDoubleScore parseScore(String scoreString)
public static SimpleDoubleScore valueOf(double score)
public double getScore()
public SimpleDoubleScore add(SimpleDoubleScore augment)
Score
augment
- value to be added to this Score
public SimpleDoubleScore subtract(SimpleDoubleScore subtrahend)
Score
subtrahend
- value to be subtracted from this Score
public SimpleDoubleScore multiply(double multiplicand)
Score
Math.floor(double)
.
/> If the implementation has a scale/precision, then the unspecified scale/precision of the double multiplicand should have no impact on the returned scale/precision.
multiplicand
- value to be multiplied by this Score.
public SimpleDoubleScore divide(double divisor)
Score
Math.floor(double)
.
/> If the implementation has a scale/precision, then the unspecified scale/precision of the double divisor should have no impact on the returned scale/precision.
divisor
- value by which this Score is to be divided
public SimpleDoubleScore power(double exponent)
Score
Math.floor(double)
.
/> If the implementation has a scale/precision, then the unspecified scale/precision of the double exponent should have no impact on the returned scale/precision.
exponent
- value by which this Score is to be powered
public Number[] toLevelNumbers()
Score
Math.floor(double)
.
The length of the returned array must be stable for a specific Score
implementation.
For example: -0hard/-7soft returns new double{-0.0, -7.0}
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(SimpleDoubleScore other)
public String toString()
toString
in class Object
|
OptaPlanner core 6.0.0.CR3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |