OptaPlanner core 6.0.0.CR2

org.optaplanner.core.impl.score.definition
Interface ScoreDefinition<S extends Score>

All Known Implementing Classes:
AbstractScoreDefinition, BendableScoreDefinition, HardMediumSoftScoreDefinition, HardSoftBigDecimalScoreDefinition, HardSoftDoubleScoreDefinition, HardSoftLongScoreDefinition, HardSoftScoreDefinition, SimpleBigDecimalScoreDefinition, SimpleDoubleScoreDefinition, SimpleLongScoreDefinition, SimpleScoreDefinition

public interface ScoreDefinition<S extends Score>

A ScoreDefinition knows how to compare Scores and what the perfect maximum/minimum Score is.

See Also:
AbstractScoreDefinition, HardSoftScoreDefinition

Method Summary
 ScoreHolder buildScoreHolder(boolean constraintMatchEnabled)
           
 double calculateTimeGradient(S startScore, S endScore, S score)
          See explanation in Termination.calculateSolverTimeGradient(DefaultSolverScope).
 String formatScore(Score score)
          Returns a String representation of the Score.
 S getPerfectMaximumScore()
          The perfect maximum Score is the Score of which there is no better in any problem instance.
 S getPerfectMinimumScore()
          The perfect minimum Score is the Score of which there is no worse in any problem instance.
 Class<S> getScoreClass()
          Returns the Class of the actual Score implementation
 Score parseScore(String scoreString)
          Parses the String and returns a Score.
 

Method Detail

getPerfectMaximumScore

S getPerfectMaximumScore()
The perfect maximum 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.

Returns:
null if not supported

getPerfectMinimumScore

S getPerfectMinimumScore()
The perfect minimum 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.

Returns:
null if not supported

getScoreClass

Class<S> getScoreClass()
Returns the Class of the actual Score implementation

Returns:
never null

formatScore

String formatScore(Score score)
Returns a String representation of the Score.

Parameters:
score - never null
Returns:
never null
See Also:
parseScore(String)

parseScore

Score parseScore(String scoreString)
Parses the String and returns a Score.

Parameters:
scoreString - never null
Returns:
never null
See Also:
formatScore(Score)

calculateTimeGradient

double calculateTimeGradient(S startScore,
                             S endScore,
                             S score)
See explanation in Termination.calculateSolverTimeGradient(DefaultSolverScope).

Parameters:
startScore - never null
endScore - never null
score - never null
Returns:
between 0.0 and 1.0

buildScoreHolder

ScoreHolder buildScoreHolder(boolean constraintMatchEnabled)
Parameters:
constraintMatchEnabled - true if ScoreHolder.isConstraintMatchEnabled() should be true
Returns:
never null

OptaPlanner core 6.0.0.CR2

Copyright © 2006-2013 JBoss by Red Hat. All Rights Reserved.