Enum Class SolutionUpdatePolicy

java.lang.Object
java.lang.Enum<SolutionUpdatePolicy>
ai.timefold.solver.core.api.solver.SolutionUpdatePolicy
All Implemented Interfaces:
Serializable, Comparable<SolutionUpdatePolicy>, Constable

public enum SolutionUpdatePolicy extends Enum<SolutionUpdatePolicy>
To fully de-normalize a planning solution freshly loaded from persistent storage, two operations need to happen:
  • Variable listeners need to run, reading the state of all entities and computing values for their shadow variables.
  • Score needs to be calculated and stored on the planning solution.

Each of these operations has its own performance cost, and for certain use cases, only one of them may be actually necessary. Advanced users therefore get a choice of which to perform.

If unsure, pick UPDATE_ALL.

  • Enum Constant Details

  • Method Details

    • values

      public static SolutionUpdatePolicy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SolutionUpdatePolicy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isScoreUpdateEnabled

      public boolean isScoreUpdateEnabled()
    • isShadowVariableUpdateEnabled

      public boolean isShadowVariableUpdateEnabled()
      If this is true, variable listeners will ignore certain fail-fasts. See InnerScoreDirector.expectShadowVariablesInCorrectState().
      Returns:
      true if shadow variables should be updated