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 java
Score calculation.
This is much faster than EasyScoreCalculator but requires much more code to implement too.
Any implementation is naturally stateful.
-
Method Summary
Modifier and TypeMethodDescriptionvoidafterEntityAdded(Object entity) voidafterEntityRemoved(Object entity) default voidafterListVariableChanged(Object entity, String variableName, int fromIndex, int toIndex) default voidafterListVariableElementAssigned(String variableName, Object element) default voidafterListVariableElementUnassigned(String variableName, Object element) voidafterVariableChanged(Object entity, String variableName) voidbeforeEntityAdded(Object entity) voidbeforeEntityRemoved(Object entity) default voidbeforeListVariableChanged(Object entity, String variableName, int fromIndex, int toIndex) default voidbeforeListVariableElementAssigned(String variableName, Object element) default voidbeforeListVariableElementUnassigned(String variableName, Object element) voidbeforeVariableChanged(Object entity, String variableName) 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 Details
-
resetWorkingSolution
There are nobeforeEntityAdded(Object)andafterEntityAdded(Object)calls for entities that are already present in the workingSolution.- Parameters:
workingSolution- never null
-
beforeEntityAdded
- Parameters:
entity- never null, an instance of aPlanningEntityclass
-
afterEntityAdded
- Parameters:
entity- never null, an instance of aPlanningEntityclass
-
beforeVariableChanged
- Parameters:
entity- never null, an instance of aPlanningEntityclassvariableName- never null, either a genuine or shadowPlanningVariable
-
afterVariableChanged
- Parameters:
entity- never null, an instance of aPlanningEntityclassvariableName- never null, either a genuine or shadowPlanningVariable
-
beforeListVariableElementAssigned
-
afterListVariableElementAssigned
-
beforeListVariableElementUnassigned
-
afterListVariableElementUnassigned
-
beforeListVariableChanged
-
afterListVariableChanged
-
beforeEntityRemoved
- Parameters:
entity- never null, an instance of aPlanningEntityclass
-
afterEntityRemoved
- Parameters:
entity- never null, an instance of aPlanningEntityclass
-
calculateScore
Score_ calculateScore()This method is only called if theScorecannot be predicted. TheScorecan be predicted for example after an undo move.- Returns:
- never null
-