Enum PlanningVariableGraphType

java.lang.Object
java.lang.Enum<PlanningVariableGraphType>
org.optaplanner.core.api.domain.variable.PlanningVariableGraphType
All Implemented Interfaces:
Serializable, Comparable<PlanningVariableGraphType>

public enum PlanningVariableGraphType extends Enum<PlanningVariableGraphType>
  • Enum Constant Details

    • NONE

      public static final PlanningVariableGraphType NONE
      This is the default.
    • CHAINED

      public static final PlanningVariableGraphType CHAINED
      Changes to this variable need to trigger chain correction.

      In some use cases, such as Vehicle Routing, planning entities are chained. A chained variable recursively points to a problem fact, which is called the anchor. So either it points directly to the anchor (that problem fact) or it points to another planning entity which recursively points to the anchor. Chains always have exactly 1 anchor, thus they never loop and the tail is always open. Chains never split into a tree: an anchor or planning entity has at most 1 trailing planning entity.

      When a chained planning entity changes position, then chain correction must happen:

      • divert the chain link at the new position to go through the modified planning entity
      • close the missing chain link at the old position
      For example: Given A <- B <- C <- D <- X <- Y, when B moves between X and Y, pointing to X, then Y is also changed to point to B and C is also changed to point to A, giving the result A <- C <- D <- X <- B <- Y.

      PlanningVariable.nullable() true is not compatible with this.

  • Method Details

    • values

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

      public static PlanningVariableGraphType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null