Annotation Type CustomShadowVariable
-
@Deprecated(forRemoval=true) @Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface CustomShadowVariable
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated in favor ofShadowVariable(normal shadow variable withvariableListenerClass()) andPiggybackShadowVariable(ifvariableListenerRef()is used).This annotation is deprecated. Below are the instructions on how to replace your@CustomShadowVariable(...)with either@ShadowVariableor@PiggybackShadowVariable.If your
@CustomShadowVariableuses thevariableListenerClassattribute, then replace the annotation with one@ShadowVariableannotation for each source@PlanningVariableReference.For example,
@CustomShadowVariable( variableListenerClass = PredecessorsDoneDateUpdatingVariableListener.class, sources = { @PlanningVariableReference(variableName = "executionMode"), @PlanningVariableReference(variableName = "delay") })becomes:@ShadowVariable( variableListenerClass = PredecessorsDoneDateUpdatingVariableListener.class, sourceVariableName = "executionMode") @ShadowVariable( variableListenerClass = PredecessorsDoneDateUpdatingVariableListener.class, sourceVariableName = "delay")If your
@CustomShadowVariableuses thevariableListenerRefattribute, then replace it with the@PiggybackShadowVariableannotation.For example,
@CustomShadowVariable( variableListenerRef = @PlanningVariableReference(variableName = "date"))becomes:@PiggybackShadowVariable(shadowVariableName = "date")
Specifies that a bean property (or a field) is a custom shadow variable of 1 or morePlanningVariables.It is specified on a getter of a java bean property (or a field) of a
PlanningEntityclass.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description PlanningVariableReference[]sourcesDeprecated, for removal: This API element is subject to removal in a future version.The source variables (leaders) that trigger a change to this shadow variable (follower).Class<? extends VariableListener>variableListenerClassDeprecated, for removal: This API element is subject to removal in a future version.AVariableListenergets notified after a source planning variable has changed.PlanningVariableReferencevariableListenerRefDeprecated, for removal: This API element is subject to removal in a future version.Use this when this shadow variable is updated by theVariableListenerof anotherCustomShadowVariable.
-
-
-
Element Detail
-
variableListenerClass
Class<? extends VariableListener> variableListenerClass
Deprecated, for removal: This API element is subject to removal in a future version.AVariableListenergets 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
VariableListenerto 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
-
-
-
sources
PlanningVariableReference[] sources
Deprecated, for removal: This API element is subject to removal in a future version.The source variables (leaders) that trigger a change to this shadow variable (follower).- Returns:
- never null (unless
variableListenerRef()is not null), at least 1
- Default:
- {}
-
-
-
variableListenerRef
PlanningVariableReference variableListenerRef
Deprecated, for removal: This API element is subject to removal in a future version.Use this when this shadow variable is updated by theVariableListenerof anotherCustomShadowVariable.- Returns:
- null if (and only if) any of the other fields is non null.
- Default:
- @org.optaplanner.core.api.domain.variable.PlanningVariableReference(variableName="")
-
-