org.optaplanner.examples.cheaptime.solver.score
Class CheapTimeIncrementalScoreCalculator
java.lang.Object
org.optaplanner.core.impl.score.director.incremental.AbstractIncrementalScoreCalculator<CheapTimeSolution>
org.optaplanner.examples.cheaptime.solver.score.CheapTimeIncrementalScoreCalculator
- All Implemented Interfaces:
- ConstraintMatchAwareIncrementalScoreCalculator<CheapTimeSolution>, IncrementalScoreCalculator<CheapTimeSolution>
public class CheapTimeIncrementalScoreCalculator
- extends AbstractIncrementalScoreCalculator<CheapTimeSolution>
- implements ConstraintMatchAwareIncrementalScoreCalculator<CheapTimeSolution>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONSTRAINT_PACKAGE
protected static final String CONSTRAINT_PACKAGE
- See Also:
- Constant Field Values
logger
protected final transient org.slf4j.Logger logger
CheapTimeIncrementalScoreCalculator
public CheapTimeIncrementalScoreCalculator()
resetWorkingSolution
public void resetWorkingSolution(CheapTimeSolution solution)
- Description copied from interface:
IncrementalScoreCalculator
- There are no
IncrementalScoreCalculator.beforeEntityAdded(Object)
and IncrementalScoreCalculator.afterEntityAdded(Object)
calls
for entities that are already present in the workingSolution.
- Specified by:
resetWorkingSolution
in interface IncrementalScoreCalculator<CheapTimeSolution>
- Parameters:
solution
- never null
beforeEntityAdded
public void beforeEntityAdded(Object entity)
- Specified by:
beforeEntityAdded
in interface IncrementalScoreCalculator<CheapTimeSolution>
afterEntityAdded
public void afterEntityAdded(Object entity)
- Specified by:
afterEntityAdded
in interface IncrementalScoreCalculator<CheapTimeSolution>
beforeVariableChanged
public void beforeVariableChanged(Object entity,
String variableName)
- Specified by:
beforeVariableChanged
in interface IncrementalScoreCalculator<CheapTimeSolution>
afterVariableChanged
public void afterVariableChanged(Object entity,
String variableName)
- Specified by:
afterVariableChanged
in interface IncrementalScoreCalculator<CheapTimeSolution>
beforeEntityRemoved
public void beforeEntityRemoved(Object entity)
- Specified by:
beforeEntityRemoved
in interface IncrementalScoreCalculator<CheapTimeSolution>
afterEntityRemoved
public void afterEntityRemoved(Object entity)
- Specified by:
afterEntityRemoved
in interface IncrementalScoreCalculator<CheapTimeSolution>
calculateScore
public HardMediumSoftLongScore calculateScore()
- Specified by:
calculateScore
in interface IncrementalScoreCalculator<CheapTimeSolution>
- Returns:
- never null
resetWorkingSolution
public void resetWorkingSolution(CheapTimeSolution workingSolution,
boolean constraintMatchEnabled)
- Description copied from interface:
ConstraintMatchAwareIncrementalScoreCalculator
- Allows for increased performance by tracking only if constraintMatchEnabled is true.
Every implementation should call
IncrementalScoreCalculator.resetWorkingSolution(Solution)
and only handle the constraintMatchEnabled parameter specifically (or ignore it).
- Specified by:
resetWorkingSolution
in interface ConstraintMatchAwareIncrementalScoreCalculator<CheapTimeSolution>
- Parameters:
workingSolution
- never null, to pass to IncrementalScoreCalculator.resetWorkingSolution(Solution)
.constraintMatchEnabled
- true if ConstraintMatchAwareIncrementalScoreCalculator.getConstraintMatchTotals()
might be called.
getConstraintMatchTotals
public Collection<ConstraintMatchTotal> getConstraintMatchTotals()
- Specified by:
getConstraintMatchTotals
in interface ConstraintMatchAwareIncrementalScoreCalculator<CheapTimeSolution>
- Returns:
- never null
- See Also:
ScoreDirector.getConstraintMatchTotals()
Copyright © 2006-2015 JBoss by Red Hat. All Rights Reserved.