|
OptaPlanner core 6.0.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.optaplanner.core.api.score.AbstractScore<BendableScore>
org.optaplanner.core.api.score.buildin.bendable.BendableScore
public final class BendableScore
This Score
is based on n levels of int constraints.
The number of levels is bendable at configuration time.
getHardLevelCount()
and getSoftLevelCount()
must be the same as in the
BendableScoreDefinition
used.
Score
,
Serialized FormConstructor Summary | |
---|---|
protected |
BendableScore(int[] hardScores,
int[] softScores)
|
Method Summary | |
---|---|
BendableScore |
add(BendableScore augment)
Returns a Score whose value is (this + augment). |
int |
compareTo(BendableScore other)
|
BendableScore |
divide(double divisor)
Returns a Score whose value is (this / divisor). |
boolean |
equals(Object o)
|
int |
getHardLevelCount()
|
int |
getHardScore(int index)
|
int |
getSoftLevelCount()
|
int |
getSoftScore(int index)
|
int |
hashCode()
|
boolean |
isFeasible()
A Solution is feasible if it has no broken hard constraints. |
BendableScore |
multiply(double multiplicand)
Returns a Score whose value is (this * multiplicand). |
static BendableScore |
parseScore(int hardLevelCount,
int softLevelCount,
String scoreString)
|
BendableScore |
power(double exponent)
Returns a Score whose value is (this ^ exponent). |
BendableScore |
subtract(BendableScore subtrahend)
Returns a Score whose value is (this - subtrahend). |
Number[] |
toLevelNumbers()
Returns an array of doubles representing the Score. |
String |
toString()
|
void |
validateCompatible(BendableScore other)
|
static BendableScore |
valueOf(int[] hardScores,
int[] softScores)
Creates a new BendableScore . |
Methods inherited from class org.optaplanner.core.api.score.AbstractScore |
---|
buildScorePattern, buildScorePattern, parseLevelStrings, parseLevelStrings |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected BendableScore(int[] hardScores, int[] softScores)
Method Detail |
---|
public static BendableScore parseScore(int hardLevelCount, int softLevelCount, String scoreString)
public static BendableScore valueOf(int[] hardScores, int[] softScores)
BendableScore
.
hardScores
- never null, never change that array afterwards: it must be immutablesoftScores
- never null, never change that array afterwards: it must be immutable
public int getHardLevelCount()
public int getHardScore(int index)
index
- 0 <= index < hardLevelCount
public int getSoftLevelCount()
public int getSoftScore(int index)
index
- 0 <= index < softLevelCount
public boolean isFeasible()
FeasibilityScore
Solution
is feasible if it has no broken hard constraints.
isFeasible
in interface FeasibilityScore<BendableScore>
public BendableScore add(BendableScore augment)
Score
add
in interface Score<BendableScore>
augment
- value to be added to this Score
public BendableScore subtract(BendableScore subtrahend)
Score
subtract
in interface Score<BendableScore>
subtrahend
- value to be subtracted from this Score
public BendableScore 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<BendableScore>
multiplicand
- value to be multiplied by this Score.
public BendableScore 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<BendableScore>
divisor
- value by which this Score is to be divided
public BendableScore 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<BendableScore>
exponent
- value by which this Score is to be powered
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 double{-0.0, -7.0}
toLevelNumbers
in interface Score<BendableScore>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(BendableScore other)
compareTo
in interface Comparable<BendableScore>
public String toString()
toString
in class Object
public void validateCompatible(BendableScore other)
|
OptaPlanner core 6.0.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |