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