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(@NonNull Object entity) voidafterEntityRemoved(@NonNull Object entity) default voidafterListVariableChanged(@NonNull Object entity, @NonNull String variableName, int fromIndex, int toIndex) default voidafterListVariableElementAssigned(@NonNull String variableName, @NonNull Object element) default voidafterListVariableElementUnassigned(@NonNull String variableName, @NonNull Object element) voidafterVariableChanged(@NonNull Object entity, @NonNull String variableName) voidbeforeEntityAdded(@NonNull Object entity) voidbeforeEntityRemoved(@NonNull Object entity) default voidbeforeListVariableChanged(@NonNull Object entity, @NonNull String variableName, int fromIndex, int toIndex) default voidbeforeListVariableElementAssigned(@NonNull String variableName, @NonNull Object element) default voidbeforeListVariableElementUnassigned(@NonNull String variableName, @NonNull Object element) voidbeforeVariableChanged(@NonNull Object entity, @NonNull String variableName) @NonNull Score_This method is only called if theScorecannot be predicted.voidresetWorkingSolution(@NonNull 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. -
beforeEntityAdded
- Parameters:
entity- an instance of aPlanningEntityclass
-
afterEntityAdded
- Parameters:
entity- an instance of aPlanningEntityclass
-
beforeVariableChanged
- Parameters:
entity- an instance of aPlanningEntityclassvariableName- either a genuine or shadowPlanningVariable
-
afterVariableChanged
- Parameters:
entity- an instance of aPlanningEntityclassvariableName- either a genuine or shadowPlanningVariable
-
beforeListVariableElementAssigned
-
afterListVariableElementAssigned
-
beforeListVariableElementUnassigned
-
afterListVariableElementUnassigned
-
beforeListVariableChanged
-
afterListVariableChanged
-
beforeEntityRemoved
- Parameters:
entity- an instance of aPlanningEntityclass
-
afterEntityRemoved
- Parameters:
entity- an instance of aPlanningEntityclass
-
calculateScore
@NonNull Score_ calculateScore()
-