|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.planner.core.score.AbstractScore<SimpleScore>
org.drools.planner.core.score.buildin.simple.DefaultSimpleScore
public final class DefaultSimpleScore
Default implementation of SimpleScore
.
SimpleScore
,
Serialized FormConstructor Summary | |
---|---|
DefaultSimpleScore(int score)
|
Method Summary | |
---|---|
SimpleScore |
add(SimpleScore augment)
Returns a Score whose value is (this + augment). |
int |
compareTo(SimpleScore other)
|
SimpleScore |
divide(double divisor)
Returns a Score whose value is (this / divisor). |
boolean |
equals(Object o)
|
int |
getScore()
The total of the broken negative constraints and fulfilled postive hard constraints. |
int |
hashCode()
|
SimpleScore |
multiply(double multiplicand)
Returns a Score whose value is (this * multiplicand). |
static DefaultSimpleScore |
parseScore(String scoreString)
|
SimpleScore |
subtract(SimpleScore subtrahend)
Returns a Score whose value is (this - subtrahend). |
double[] |
toDoubleArray()
Returns an array of doubles representing the Score. |
String |
toString()
|
static DefaultSimpleScore |
valueOf(int score)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultSimpleScore(int score)
Method Detail |
---|
public static DefaultSimpleScore parseScore(String scoreString)
public static DefaultSimpleScore valueOf(int score)
public int getScore()
SimpleScore
getScore
in interface SimpleScore
public SimpleScore add(SimpleScore augment)
Score
add
in interface Score<SimpleScore>
augment
- value to be added to this Score
public SimpleScore subtract(SimpleScore subtrahend)
Score
subtract
in interface Score<SimpleScore>
subtrahend
- value to be subtracted from this Score
public SimpleScore multiply(double multiplicand)
Score
Math.floor(double)
.
multiply
in interface Score<SimpleScore>
multiplicand
- value to be multiplied by this Score.
public SimpleScore divide(double divisor)
Score
Math.floor(double)
.
divide
in interface Score<SimpleScore>
divisor
- value by which this Score is to be divided
public double[] toDoubleArray()
Score
Math.floor(double)
.
A greater score level uses a lower array index than a lesser score level.
The length of the returned array is stable for a specific Score implementation.
For example: -0hard/-7soft returns new double{-0.0, -7.0}
toDoubleArray
in interface Score<SimpleScore>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(SimpleScore other)
compareTo
in interface Comparable<SimpleScore>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |