Package org.optaplanner.core.api.domain.variable

## 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 Summary

    Enum Constants
    Enum Constant | Description
    --- | ---
    `CHAINED` | Changes to this variable need to trigger chain correction.
    `NONE` | This is the default.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static PlanningVariableGraphType` | `valueOf​(String name)` | Returns the enum constant of this type with the specified name.
    `static PlanningVariableGraphType[]` | `values()` | Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### 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: a 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 Detail

    - #### values

          public static PlanningVariableGraphType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (PlanningVariableGraphType c : PlanningVariableGraphType.values())
              System.out.println(c);

      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