Drools Planner distribution 6.0.0-SNAPSHOT

org.drools.planner.core.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()
          TODO JBRULES-2238 remove when the rule that sums the final score can be written as a single rule and ScoreHolder is dead
 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()
TODO JBRULES-2238 remove when the rule that sums the final score can be written as a single rule and ScoreHolder is dead

Returns:
never null

Drools Planner distribution 6.0.0-SNAPSHOT

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