Interface VariableListener<Entity_>
-
- All Superinterfaces:
AutoCloseable,Closeable,Supply,VariableListener<Entity_>
- All Known Subinterfaces:
SourcedVariableListener<Entity_>,StatefulVariableListener<Entity_>
- All Known Implementing Classes:
AnchorVariableListener,CollectionInverseVariableListener,ExternalizedAnchorVariableSupply,ExternalizedCollectionInverseVariableSupply,ExternalizedSingletonInverseVariableSupply,SingletonInverseVariableListener
@Deprecated public interface VariableListener<Entity_> extends VariableListener<Entity_>, Supply
Deprecated.in favor ofVariableListenerChanges shadow variables when a genuine planning variable changes.Important: it must only change the shadow variable(s) for which it's configured! It should never change a genuine variable or a problem fact. It can change its shadow variable(s) on multiple entity instances (for example: an arrivalTime change affects all trailing entities too).
Each
ScoreDirectorhas a differentVariableListenerinstance, so it can be stateful. If it is stateful, it must implementStatefulVariableListener.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidafterEntityAdded(ScoreDirector scoreDirector, Entity_ entity)Deprecated.voidafterEntityRemoved(ScoreDirector scoreDirector, Entity_ entity)Deprecated.voidafterVariableChanged(ScoreDirector scoreDirector, Entity_ entity)Deprecated.voidbeforeEntityAdded(ScoreDirector scoreDirector, Entity_ entity)Deprecated.voidbeforeEntityRemoved(ScoreDirector scoreDirector, Entity_ entity)Deprecated.voidbeforeVariableChanged(ScoreDirector scoreDirector, Entity_ entity)Deprecated.default booleanrequiresUniqueEntityEvents()Deprecated.When set totrue, this has a slight performance loss in Planner.-
Methods inherited from interface org.optaplanner.core.api.domain.variable.VariableListener
close, resetWorkingSolution
-
-
-
-
Method Detail
-
requiresUniqueEntityEvents
default boolean requiresUniqueEntityEvents()
Deprecated.When set totrue, this has a slight performance loss in Planner. When set tofalse, it's often easier to make the listener implementation correct and fast.- Specified by:
requiresUniqueEntityEventsin interfaceVariableListener<Entity_>- Returns:
- true to guarantee that each of the before/after methods will only be called once per entity instance per operation type (add, change or remove).
-
beforeEntityAdded
void beforeEntityAdded(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.- Specified by:
beforeEntityAddedin interfaceVariableListener<Entity_>- Parameters:
scoreDirector- never nullentity- never null
-
afterEntityAdded
void afterEntityAdded(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.- Specified by:
afterEntityAddedin interfaceVariableListener<Entity_>- Parameters:
scoreDirector- never nullentity- never null
-
beforeVariableChanged
void beforeVariableChanged(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.- Specified by:
beforeVariableChangedin interfaceVariableListener<Entity_>- Parameters:
scoreDirector- never nullentity- never null
-
afterVariableChanged
void afterVariableChanged(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.- Specified by:
afterVariableChangedin interfaceVariableListener<Entity_>- Parameters:
scoreDirector- never nullentity- never null
-
beforeEntityRemoved
void beforeEntityRemoved(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.- Specified by:
beforeEntityRemovedin interfaceVariableListener<Entity_>- Parameters:
scoreDirector- never nullentity- never null
-
afterEntityRemoved
void afterEntityRemoved(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.- Specified by:
afterEntityRemovedin interfaceVariableListener<Entity_>- Parameters:
scoreDirector- never nullentity- never null
-
-