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