Annotation Interface ShadowVariableLooped


@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface ShadowVariableLooped
Specifies that a boolean property (or field) of a PlanningEntity tracks if any of its supplier variables are looped.

A supplier variable is looped if:

  • One of its source variables include it as a source (for example, `a` depends on `b` and `b` depends on `a`).
  • One of its source variables is looped (for example, `c` depends on `a`, which depends on `b`, and `b` depends on `a`).

Should be used in a filter for a hard Constraint to penalize looped entities, since PlanningSolution with looped entities are typically not valid.

Important: Do not use a ShadowVariableLooped property in a method annotated with ShadowSources. ShadowVariableLooped properties can be updated after the ShadowSources marked method is called, causing score corruption. ShadowSources marked methods do not need to check ShadowVariableLooped properties, since they are only called if all their dependencies are not looped.