|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.planner.core.score.AbstractScore<SimpleDoubleScore>
org.drools.planner.core.score.buildin.simpledouble.DefaultSimpleDoubleScore
public final class DefaultSimpleDoubleScore
Default implementation of SimpleDoubleScore
.
SimpleDoubleScore
,
Serialized FormConstructor Summary | |
---|---|
DefaultSimpleDoubleScore(double score)
|
Method 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 postive hard constraints. |
int |
hashCode()
|
SimpleDoubleScore |
multiply(double multiplicand)
Returns a Score whose value is (this * multiplicand). |
static DefaultSimpleDoubleScore |
parseScore(String scoreString)
|
SimpleDoubleScore |
subtract(SimpleDoubleScore subtrahend)
Returns a Score whose value is (this - subtrahend). |
double[] |
toDoubleLevels()
Returns an array of doubles representing the Score. |
String |
toString()
|
static DefaultSimpleDoubleScore |
valueOf(double score)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultSimpleDoubleScore(double score)
Method Detail |
---|
public static DefaultSimpleDoubleScore parseScore(String scoreString)
public static DefaultSimpleDoubleScore valueOf(double score)
public double getScore()
SimpleDoubleScore
getScore
in interface SimpleDoubleScore
public SimpleDoubleScore add(SimpleDoubleScore augment)
Score
add
in interface Score<SimpleDoubleScore>
augment
- value to be added to this Score
public SimpleDoubleScore subtract(SimpleDoubleScore subtrahend)
Score
subtract
in interface Score<SimpleDoubleScore>
subtrahend
- value to be subtracted from this Score
public SimpleDoubleScore multiply(double multiplicand)
Score
Math.floor(double)
.
multiply
in interface Score<SimpleDoubleScore>
multiplicand
- value to be multiplied by this Score.
public SimpleDoubleScore divide(double divisor)
Score
Math.floor(double)
.
divide
in interface Score<SimpleDoubleScore>
divisor
- value by which this Score is to be divided
public double[] toDoubleLevels()
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}
toDoubleLevels
in interface Score<SimpleDoubleScore>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(SimpleDoubleScore other)
compareTo
in interface Comparable<SimpleDoubleScore>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |