Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.drools.planner.core.score.definition
Class HardAndSoftScoreDefinition

    java.lang.Object
      org.drools.planner.core.score.definition.AbstractScoreDefinition<HardAndSoftScore>
          org.drools.planner.core.score.definition.HardAndSoftScoreDefinition

All Implemented Interfaces:
  Serializable, ScoreDefinition<HardAndSoftScore>

    public class HardAndSoftScoreDefinition

extends AbstractScoreDefinition<HardAndSoftScore>

See Also:
  Serialized Form

Constructor Summary
`HardAndSoftScoreDefinition()`

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(HardAndSoftScore startScore, HardAndSoftScore endScore, HardAndSoftScore score)` See explanation in `Termination.calculateSolverTimeGradient(DefaultSolverScope)`.
`HardAndSoftScore` | `getPerfectMaximumScore()` The perfect maximum score is the score of which there is no better in any problem instance.
`HardAndSoftScore` | `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` | `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(HardAndSoftScore perfectMaximumScore)`
`void` | `setPerfectMinimumScore(HardAndSoftScore perfectMinimumScore)`
`Double` | `translateScoreToGraphValue(HardAndSoftScore score)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### HardAndSoftScoreDefinition

    public HardAndSoftScoreDefinition()

Method Detail

### setHardScoreTimeGradientWeight

    public 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, ...

  Parameters:
    `hardScoreTimeGradientWeight` - 0.0 <= hardScoreTimeGradientWeight <= 1.0

### setPerfectMaximumScore

    public void setPerfectMaximumScore(HardAndSoftScore perfectMaximumScore)

### setPerfectMinimumScore

    public void setPerfectMinimumScore(HardAndSoftScore perfectMinimumScore)

### getPerfectMaximumScore

    public HardAndSoftScore 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<HardAndSoftScore>`
  Overrides:
    `getPerfectMaximumScore` in class `AbstractScoreDefinition<HardAndSoftScore>`
  Returns:
    null if not supported

### getPerfectMinimumScore

    public HardAndSoftScore 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<HardAndSoftScore>`
  Overrides:
    `getPerfectMinimumScore` in class `AbstractScoreDefinition<HardAndSoftScore>`
  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(HardAndSoftScore startScore,
                                        HardAndSoftScore endScore,
                                        HardAndSoftScore 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(HardAndSoftScore 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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