org.drools.planner.core.score.buildin.simple
Class SimpleScoreDefinition

java.lang.Object
  extended by org.drools.planner.core.score.definition.AbstractScoreDefinition<SimpleScore>
      extended by org.drools.planner.core.score.buildin.simple.SimpleScoreDefinition
All Implemented Interfaces:
Serializable, ScoreDefinition<SimpleScore>

public class SimpleScoreDefinition
extends AbstractScoreDefinition<SimpleScore>

See Also:
Serialized Form

Constructor Summary
SimpleScoreDefinition()
           
 
Method Summary
 ScoreCalculator buildScoreCalculator()
          TODO remove when the rule that sums the final score can be written as a single rule and ScoreCalculator is dead
 double calculateTimeGradient(SimpleScore startScore, SimpleScore endScore, SimpleScore score)
          See explanation in Termination.calculateSolverTimeGradient(DefaultSolverScope).
 SimpleScore getPerfectMaximumScore()
          The perfect maximum score is the score of which there is no better in any problem instance.
 SimpleScore getPerfectMinimumScore()
          The perfect minimum score is the score of which there is no worser in any problem instance.
 Score parseScore(String scoreString)
          Parses the String and returns a Score.
 void setPerfectMaximumScore(SimpleScore perfectMaximumScore)
           
 void setPerfectMinimumScore(SimpleScore perfectMinimumScore)
           
 Double translateScoreToGraphValue(SimpleScore score)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleScoreDefinition

public SimpleScoreDefinition()
Method Detail

setPerfectMaximumScore

public void setPerfectMaximumScore(SimpleScore perfectMaximumScore)

setPerfectMinimumScore

public void setPerfectMinimumScore(SimpleScore perfectMinimumScore)

getPerfectMaximumScore

public SimpleScore getPerfectMaximumScore()
Description copied from interface: ScoreDefinition
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 scores.

Specified by:
getPerfectMaximumScore in interface ScoreDefinition<SimpleScore>
Overrides:
getPerfectMaximumScore in class AbstractScoreDefinition<SimpleScore>
Returns:
null if not supported

getPerfectMinimumScore

public SimpleScore getPerfectMinimumScore()
Description copied from interface: ScoreDefinition
The perfect minimum score is the score of which there is no worser 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.

Specified by:
getPerfectMinimumScore in interface ScoreDefinition<SimpleScore>
Overrides:
getPerfectMinimumScore in class AbstractScoreDefinition<SimpleScore>
Returns:
null if not supported

parseScore

public Score parseScore(String scoreString)
Description copied from interface: ScoreDefinition
Parses the String and returns a Score.

Parameters:
scoreString - never null
Returns:
never null

calculateTimeGradient

public double calculateTimeGradient(SimpleScore startScore,
                                    SimpleScore endScore,
                                    SimpleScore score)
Description copied from interface: ScoreDefinition
See explanation in Termination.calculateSolverTimeGradient(DefaultSolverScope).

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

translateScoreToGraphValue

public Double translateScoreToGraphValue(SimpleScore score)
Parameters:
score - never null
Returns:
null if should not be shown on the graph

buildScoreCalculator

public ScoreCalculator buildScoreCalculator()
Description copied from interface: ScoreDefinition
TODO remove when the rule that sums the final score can be written as a single rule and ScoreCalculator is dead

Returns:
never null


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