|
OptaPlanner core 6.2.0.CR2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.optaplanner.core.api.score.AbstractScore<HardMediumSoftLongScore>
org.optaplanner.core.api.score.buildin.hardmediumsoftlong.HardMediumSoftLongScore
public final class HardMediumSoftLongScore
This Score
is based on 3 levels of long constraints: hard, medium and soft.
Hard constraints have priority over medium constraints.
Medium constraints have priority over soft constraints.
Score
,
Serialized FormMethod Summary | |
---|---|
HardMediumSoftLongScore |
add(HardMediumSoftLongScore augment)
Returns a Score whose value is (this + augment). |
int |
compareTo(HardMediumSoftLongScore other)
|
HardMediumSoftLongScore |
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 |
getMediumScore()
The total of the broken negative medium constraints and fulfilled positive medium constraints. |
long |
getSoftScore()
The total of the broken negative soft constraints and fulfilled positive soft constraints. |
int |
hashCode()
|
boolean |
isFeasible()
A Solution is feasible if it has no broken hard constraints. |
HardMediumSoftLongScore |
multiply(double multiplicand)
Returns a Score whose value is (this * multiplicand). |
HardMediumSoftLongScore |
negate()
Returns a Score whose value is (- this). |
static HardMediumSoftLongScore |
parseScore(String scoreString)
|
HardMediumSoftLongScore |
power(double exponent)
Returns a Score whose value is (this ^ exponent). |
HardMediumSoftLongScore |
subtract(HardMediumSoftLongScore subtrahend)
Returns a Score whose value is (this - subtrahend). |
Number[] |
toLevelNumbers()
Returns an array of numbers representing the Score. |
String |
toString()
|
static HardMediumSoftLongScore |
valueOf(long hardScore,
long mediumScore,
long softScore)
|
Methods inherited from class org.optaplanner.core.api.score.AbstractScore |
---|
buildScorePattern, buildScorePattern, isCompatibleArithmeticArgument, parseLevelAsBigDecimal, parseLevelAsDouble, parseLevelAsInt, parseLevelAsLong, parseLevelStrings, parseLevelStrings |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.optaplanner.core.api.score.Score |
---|
isCompatibleArithmeticArgument |
Method Detail |
---|
public static HardMediumSoftLongScore parseScore(String scoreString)
public static HardMediumSoftLongScore valueOf(long hardScore, long mediumScore, long softScore)
public long getHardScore()
public long getMediumScore()
public long getSoftScore()
public boolean isFeasible()
Solution
is feasible if it has no broken hard constraints.
isFeasible
in interface FeasibilityScore<HardMediumSoftLongScore>
getHardScore()
is 0 or higherpublic HardMediumSoftLongScore add(HardMediumSoftLongScore augment)
Score
add
in interface Score<HardMediumSoftLongScore>
augment
- value to be added to this Score
public HardMediumSoftLongScore subtract(HardMediumSoftLongScore subtrahend)
Score
subtract
in interface Score<HardMediumSoftLongScore>
subtrahend
- value to be subtracted from this Score
public HardMediumSoftLongScore multiply(double multiplicand)
Score
Math.floor(double)
.
/> If the implementation has a scale/precision, then the unspecified scale/precision of the double multiplicand should have no impact on the returned scale/precision.
multiply
in interface Score<HardMediumSoftLongScore>
multiplicand
- value to be multiplied by this Score.
public HardMediumSoftLongScore divide(double divisor)
Score
Math.floor(double)
.
/> If the implementation has a scale/precision, then the unspecified scale/precision of the double divisor should have no impact on the returned scale/precision.
divide
in interface Score<HardMediumSoftLongScore>
divisor
- value by which this Score is to be divided
public HardMediumSoftLongScore power(double exponent)
Score
Math.floor(double)
.
/> If the implementation has a scale/precision, then the unspecified scale/precision of the double exponent should have no impact on the returned scale/precision.
power
in interface Score<HardMediumSoftLongScore>
exponent
- value by which this Score is to be powered
public HardMediumSoftLongScore negate()
Score
negate
in interface Score<HardMediumSoftLongScore>
public Number[] toLevelNumbers()
Score
Math.floor(double)
.
The length of the returned array must be stable for a specific Score
implementation.
For example: -0hard/-7soft returns new int{-0, -7}
toLevelNumbers
in interface Score<HardMediumSoftLongScore>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(HardMediumSoftLongScore other)
compareTo
in interface Comparable<HardMediumSoftLongScore>
public String toString()
toString
in class Object
|
OptaPlanner core 6.2.0.CR2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |