Interface IncrementalScoreCalculator<Solution_,Score_ extends Score<Score_>>

Type Parameters:
Solution_ - the solution type, the class with the PlanningSolution annotation
Score_ - 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 Details

    • resetWorkingSolution

      void resetWorkingSolution(@NonNull Solution_ workingSolution)
      There are no beforeEntityAdded(Object) and afterEntityAdded(Object) calls for entities that are already present in the workingSolution.
    • beforeEntityAdded

      void beforeEntityAdded(@NonNull Object entity)
      Parameters:
      entity - an instance of a PlanningEntity class
    • afterEntityAdded

      void afterEntityAdded(@NonNull Object entity)
      Parameters:
      entity - an instance of a PlanningEntity class
    • beforeVariableChanged

      void beforeVariableChanged(@NonNull Object entity, @NonNull String variableName)
      Parameters:
      entity - an instance of a PlanningEntity class
      variableName - either a genuine or shadow PlanningVariable
    • afterVariableChanged

      void afterVariableChanged(@NonNull Object entity, @NonNull String variableName)
      Parameters:
      entity - an instance of a PlanningEntity class
      variableName - either a genuine or shadow PlanningVariable
    • beforeListVariableElementAssigned

      default void beforeListVariableElementAssigned(@NonNull String variableName, @NonNull Object element)
    • afterListVariableElementAssigned

      default void afterListVariableElementAssigned(@NonNull String variableName, @NonNull Object element)
    • beforeListVariableElementUnassigned

      default void beforeListVariableElementUnassigned(@NonNull String variableName, @NonNull Object element)
    • afterListVariableElementUnassigned

      default void afterListVariableElementUnassigned(@NonNull String variableName, @NonNull Object element)
    • beforeListVariableChanged

      default void beforeListVariableChanged(@NonNull Object entity, @NonNull String variableName, int fromIndex, int toIndex)
    • afterListVariableChanged

      default void afterListVariableChanged(@NonNull Object entity, @NonNull String variableName, int fromIndex, int toIndex)
    • beforeEntityRemoved

      void beforeEntityRemoved(@NonNull Object entity)
      Parameters:
      entity - an instance of a PlanningEntity class
    • afterEntityRemoved

      void afterEntityRemoved(@NonNull Object entity)
      Parameters:
      entity - an instance of a PlanningEntity class
    • calculateScore

      @NonNull Score_ calculateScore()
      This method is only called if the Score cannot be predicted. The Score can be predicted for example after an undo move.