org.optaplanner.core.impl.score.buildin.hardsoftlong
public class HardSoftLongScoreDefinition extends AbstractScoreDefinition<HardSoftLongScore>
Constructor and Description |
---|
HardSoftLongScoreDefinition() |
Modifier and Type | Method and Description |
---|---|
ScoreHolder |
buildScoreHolder(boolean constraintMatchEnabled) |
double |
calculateTimeGradient(HardSoftLongScore startScore,
HardSoftLongScore endScore,
HardSoftLongScore score)
See explanation in
Termination.calculateSolverTimeGradient(DefaultSolverScope) . |
double |
getHardScoreTimeGradientWeight() |
HardSoftLongScore |
getPerfectMaximumScore()
|
HardSoftLongScore |
getPerfectMinimumScore()
|
Class<HardSoftLongScore> |
getScoreClass()
|
Score |
parseScore(String scoreString)
|
void |
setHardScoreTimeGradientWeight(double hardScoreTimeGradientWeight)
It's recommended to use a number which can be exactly represented as a double,
such as 0.5, 0.25, 0.75, 0.125, ... but not 0.1, 0.2, ...
|
void |
setPerfectMaximumScore(HardSoftLongScore perfectMaximumScore) |
void |
setPerfectMinimumScore(HardSoftLongScore perfectMinimumScore) |
formatScore
public double getHardScoreTimeGradientWeight()
public void setHardScoreTimeGradientWeight(double hardScoreTimeGradientWeight)
hardScoreTimeGradientWeight
- 0.0 <= hardScoreTimeGradientWeight <= 1.0public HardSoftLongScore getPerfectMaximumScore()
ScoreDefinition
Score
is the Score
of which there is no better in any problem instance.
This doesn't mean that the current problem instance, or any problem instance for that matter,
could ever attain that Score
.
For example, most cases have a perfect maximum Score
of zero, as most use cases only have negative
constraints.getPerfectMaximumScore
in interface ScoreDefinition<HardSoftLongScore>
getPerfectMaximumScore
in class AbstractScoreDefinition<HardSoftLongScore>
public void setPerfectMaximumScore(HardSoftLongScore perfectMaximumScore)
public HardSoftLongScore getPerfectMinimumScore()
ScoreDefinition
Score
is the Score
of which there is no worse in any problem instance.
This doesn't mean that the current problem instance, or any problem instance for that matter,
could ever attain such a bad Score
.
For example, most cases have a perfect minimum Score
of negative infinity.getPerfectMinimumScore
in interface ScoreDefinition<HardSoftLongScore>
getPerfectMinimumScore
in class AbstractScoreDefinition<HardSoftLongScore>
public void setPerfectMinimumScore(HardSoftLongScore perfectMinimumScore)
public Class<HardSoftLongScore> getScoreClass()
ScoreDefinition
public Score parseScore(String scoreString)
ScoreDefinition
scoreString
- never nullScoreDefinition.formatScore(Score)
public double calculateTimeGradient(HardSoftLongScore startScore, HardSoftLongScore endScore, HardSoftLongScore score)
ScoreDefinition
Termination.calculateSolverTimeGradient(DefaultSolverScope)
.startScore
- never nullendScore
- never nullscore
- never nullpublic ScoreHolder buildScoreHolder(boolean constraintMatchEnabled)
constraintMatchEnabled
- true if ScoreHolder.isConstraintMatchEnabled()
should be trueCopyright © 2006-2013 JBoss by Red Hat. All Rights Reserved.