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 Detail

      • 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
      • 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