Interface IncrementalScoreCalculator<Solution_,Score_ extends Score<Score_>>
-
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotationScore_- the score type to go with the solution
- All Known Subinterfaces:
ConstraintMatchAwareIncrementalScoreCalculator<Solution_,Score_>
public interface IncrementalScoreCalculator<Solution_,Score_ extends Score<Score_>>Used for incremental javaScorecalculation. This is much faster thanEasyScoreCalculatorbut requires much more code to implement too.Any implementation is naturally stateful.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidafterEntityAdded(Object entity)voidafterEntityRemoved(Object entity)voidafterVariableChanged(Object entity, String variableName)voidbeforeEntityAdded(Object entity)voidbeforeEntityRemoved(Object entity)voidbeforeVariableChanged(Object entity, String variableName)Score_calculateScore()This method is only called if theScorecannot be predicted.voidresetWorkingSolution(Solution_ workingSolution)There are nobeforeEntityAdded(Object)andafterEntityAdded(Object)calls for entities that are already present in the workingSolution.
-
-
-
Method Detail
-
resetWorkingSolution
void resetWorkingSolution(Solution_ workingSolution)
There are nobeforeEntityAdded(Object)andafterEntityAdded(Object)calls for entities that are already present in the workingSolution.- Parameters:
workingSolution- never null
-
beforeEntityAdded
void beforeEntityAdded(Object entity)
- Parameters:
entity- never null, an instance of aPlanningEntityclass
-
afterEntityAdded
void afterEntityAdded(Object entity)
- Parameters:
entity- never null, an instance of aPlanningEntityclass
-
beforeVariableChanged
void beforeVariableChanged(Object entity, String variableName)
- Parameters:
entity- never null, an instance of aPlanningEntityclassvariableName- never null, either a genuine or shadowPlanningVariable
-
afterVariableChanged
void afterVariableChanged(Object entity, String variableName)
- Parameters:
entity- never null, an instance of aPlanningEntityclassvariableName- never null, either a genuine or shadowPlanningVariable
-
beforeEntityRemoved
void beforeEntityRemoved(Object entity)
- Parameters:
entity- never null, an instance of aPlanningEntityclass
-
afterEntityRemoved
void afterEntityRemoved(Object entity)
- Parameters:
entity- never null, an instance of aPlanningEntityclass
-
-