OptaPlanner core 6.1.0.Beta2

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

All Known Implementing Classes:
AbstractScoreDefinition, BendableScoreDefinition, HardMediumSoftLongScoreDefinition, 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
 S buildOptimisticBound(InitializingScoreTrend initializingScoreTrend, S score)
          Builds a Score which is equal or better than any other Score with more variables initialized (while the already variables don't change).
 S buildPessimisticBound(InitializingScoreTrend initializingScoreTrend, S score)
          Builds a Score which is equal or worse than any other Score with more variables initialized (while the already variables don't change).
 ScoreHolder buildScoreHolder(boolean constraintMatchEnabled)
          Used by DroolsScoreDirector.
 double calculateTimeGradient(S startScore, S endScore, S score)
          See explanation in Termination.calculateSolverTimeGradient(DefaultSolverScope).
 String formatScore(S score)
          Returns a String representation of the Score.
 int getLevelCount()
           
 Class<S> getScoreClass()
          Returns the Class of the actual Score implementation
 S parseScore(String scoreString)
          Parses the String and returns a Score.
 

Method Detail

getLevelCount

int getLevelCount()
Returns:
at least 1

getScoreClass

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

Returns:
never null

formatScore

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

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

parseScore

S 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)
Used by DroolsScoreDirector.

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

buildOptimisticBound

S buildOptimisticBound(InitializingScoreTrend initializingScoreTrend,
                       S score)
Builds a Score which is equal or better than any other Score with more variables initialized (while the already variables don't change).

Parameters:
initializingScoreTrend - never null, with InitializingScoreTrend.getLevelCount() equal to getLevelCount().
score - never null
Returns:
never null

buildPessimisticBound

S buildPessimisticBound(InitializingScoreTrend initializingScoreTrend,
                        S score)
Builds a Score which is equal or worse than any other Score with more variables initialized (while the already variables don't change).

Parameters:
initializingScoreTrend - never null, with InitializingScoreTrend.getLevelCount() equal to getLevelCount().
score - never null
Returns:
never null

OptaPlanner core 6.1.0.Beta2

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