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(Solution_ workingSolution)
      There are no beforeEntityAdded(Object) and afterEntityAdded(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 a PlanningEntity class
    • afterEntityAdded

      void afterEntityAdded(Object entity)
      Parameters:
      entity - never null, an instance of a PlanningEntity class
    • beforeVariableChanged

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

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

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

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

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

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

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

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

      void beforeEntityRemoved(Object entity)
      Parameters:
      entity - never null, an instance of a PlanningEntity class
    • afterEntityRemoved

      void afterEntityRemoved(Object entity)
      Parameters:
      entity - never null, an instance of a PlanningEntity class
    • calculateScore

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