Annotation Type CustomShadowVariable

    • Element Detail

      • variableListenerClass

        Class<? extends VariableListener> variableListenerClass
        A VariableListener gets notified after a source planning variable has changed. That listener changes the shadow variable (often recursively on multiple planning entities) accordingly, Those shadow variables should make the score calculation more natural to write.

        For example: VRP with time windows uses a VariableListener to update the arrival times of all the trailing entities when an entity is changed.

        Returns:
        never null (unless variableListenerRef() is not null)
        Default:
        org.optaplanner.core.api.domain.variable.CustomShadowVariable.NullVariableListener.class
      • variableListenerRef

        PlanningVariableReference variableListenerRef
        Use this when this shadow variable is updated by the VariableListener of another CustomShadowVariable.
        Returns:
        null if (and only if) any of the other fields is non null.
        Default:
        @org.optaplanner.core.api.domain.variable.PlanningVariableReference(variableName="")