|
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<HardSoftLongScore>
org.optaplanner.core.api.score.buildin.hardsoftlong.HardSoftLongScore
public final class HardSoftLongScore
This Score
is based on 2 levels of long constraints: hard and soft.
Hard constraints have priority over soft constraints.
Score
,
Serialized FormMethod Summary | |
---|---|
HardSoftLongScore |
add(HardSoftLongScore augment)
Returns a Score whose value is (this + augment). |
int |
compareTo(HardSoftLongScore other)
|
HardSoftLongScore |
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()
A Solution is feasible if it has no broken hard constraints. |
HardSoftLongScore |
multiply(double multiplicand)
Returns a Score whose value is (this * multiplicand). |
HardSoftLongScore |
negate()
Returns a Score whose value is (- this). |
static HardSoftLongScore |
parseScore(String scoreString)
|
HardSoftLongScore |
power(double exponent)
Returns a Score whose value is (this ^ exponent). |
HardSoftLongScore |
subtract(HardSoftLongScore subtrahend)
Returns a Score whose value is (this - subtrahend). |
Number[] |
toLevelNumbers()
Returns an array of numbers representing the Score. |
String |
toString()
|
static HardSoftLongScore |
valueOf(long hardScore,
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 HardSoftLongScore parseScore(String scoreString)
public static HardSoftLongScore valueOf(long hardScore, long softScore)
public long getHardScore()
public long getSoftScore()
public boolean isFeasible()
FeasibilityScore
Solution
is feasible if it has no broken hard constraints.
isFeasible
in interface FeasibilityScore<HardSoftLongScore>
public HardSoftLongScore add(HardSoftLongScore augment)
Score
add
in interface Score<HardSoftLongScore>
augment
- value to be added to this Score
public HardSoftLongScore subtract(HardSoftLongScore subtrahend)
Score
subtract
in interface Score<HardSoftLongScore>
subtrahend
- value to be subtracted from this Score
public HardSoftLongScore 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<HardSoftLongScore>
multiplicand
- value to be multiplied by this Score.
public HardSoftLongScore 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<HardSoftLongScore>
divisor
- value by which this Score is to be divided
public HardSoftLongScore 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<HardSoftLongScore>
exponent
- value by which this Score is to be powered
public HardSoftLongScore negate()
Score
negate
in interface Score<HardSoftLongScore>
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<HardSoftLongScore>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(HardSoftLongScore other)
compareTo
in interface Comparable<HardSoftLongScore>
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 |