|
||||||||||
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 FormConstructor 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 HardAndSoftLongScore
public long getSoftScore()
HardAndSoftLongScore
getSoftScore
in interface HardAndSoftLongScore
public boolean isFeasible()
isFeasible
in interface HardAndSoftLongScore
HardAndSoftLongScore.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)
Score
Math.floor(double)
.
multiply
in interface Score<HardAndSoftLongScore>
multiplicand
- value to be multiplied by this Score.
public HardAndSoftLongScore divide(double divisor)
Score
Math.floor(double)
.
divide
in interface Score<HardAndSoftLongScore>
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<HardAndSoftLongScore>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public 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 |