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