|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.drools.planner.core.score.AbstractScore<HardAndSoftScore>
org.drools.planner.core.score.DefaultHardAndSoftScore
public final class DefaultHardAndSoftScore
Default implementation of HardAndSoftScore.
HardAndSoftScore,
Serialized Form| Constructor Summary | |
|---|---|
DefaultHardAndSoftScore(int hardScore)
|
|
DefaultHardAndSoftScore(int hardScore,
int softScore)
|
|
| Method Summary | |
|---|---|
HardAndSoftScore |
add(HardAndSoftScore augment)
Returns a Score whose value is (this + augment). |
int |
compareTo(HardAndSoftScore other)
|
HardAndSoftScore |
divide(double divisor)
Returns a Score whose value is (this / divisor). |
boolean |
equals(Object o)
|
int |
getHardScore()
The total of the broken negative hard constraints and fulfilled positive hard constraints. |
int |
getSoftScore()
The total of the broken negative soft constraints and fulfilled positive soft constraints. |
int |
hashCode()
|
HardAndSoftScore |
multiply(double multiplicand)
Returns a Score whose value is (this * multiplicand). |
static DefaultHardAndSoftScore |
parseScore(String scoreString)
|
HardAndSoftScore |
subtract(HardAndSoftScore subtrahend)
Returns a Score whose value is (this - subtrahend). |
double[] |
toDoubleArray()
Returns an array of doubles representing the Score. |
String |
toString()
|
static DefaultHardAndSoftScore |
valueOf(int hardScore)
|
static DefaultHardAndSoftScore |
valueOf(int hardScore,
int softScore)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultHardAndSoftScore(int hardScore)
public DefaultHardAndSoftScore(int hardScore,
int softScore)
| Method Detail |
|---|
public static DefaultHardAndSoftScore parseScore(String scoreString)
public static DefaultHardAndSoftScore valueOf(int hardScore)
public static DefaultHardAndSoftScore valueOf(int hardScore,
int softScore)
public int getHardScore()
HardAndSoftScore
getHardScore in interface HardAndSoftScorepublic int getSoftScore()
HardAndSoftScore
getSoftScore in interface HardAndSoftScorepublic HardAndSoftScore add(HardAndSoftScore augment)
Score
add in interface Score<HardAndSoftScore>augment - value to be added to this Score
public HardAndSoftScore subtract(HardAndSoftScore subtrahend)
Score
subtract in interface Score<HardAndSoftScore>subtrahend - value to be subtracted from this Score
public HardAndSoftScore multiply(double multiplicand)
ScoreMath.floor(double).
multiply in interface Score<HardAndSoftScore>multiplicand - value to be multiplied by this Score.
public HardAndSoftScore divide(double divisor)
ScoreMath.floor(double).
divide in interface Score<HardAndSoftScore>divisor - value by which this Score is to be divided
public double[] toDoubleArray()
ScoreMath.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<HardAndSoftScore>public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic int compareTo(HardAndSoftScore other)
compareTo in interface Comparable<HardAndSoftScore>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||