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 ofVariableListener
Changes 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
ScoreDirector
has a differentVariableListener
instance, 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 void
afterEntityAdded(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.void
afterEntityRemoved(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.void
afterVariableChanged(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.void
beforeEntityAdded(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.void
beforeEntityRemoved(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.void
beforeVariableChanged(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.default boolean
requiresUniqueEntityEvents()
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:
requiresUniqueEntityEvents
in 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:
beforeEntityAdded
in interfaceVariableListener<Entity_>
- Parameters:
scoreDirector
- never nullentity
- never null
-
afterEntityAdded
void afterEntityAdded(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.- Specified by:
afterEntityAdded
in interfaceVariableListener<Entity_>
- Parameters:
scoreDirector
- never nullentity
- never null
-
beforeVariableChanged
void beforeVariableChanged(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.- Specified by:
beforeVariableChanged
in interfaceVariableListener<Entity_>
- Parameters:
scoreDirector
- never nullentity
- never null
-
afterVariableChanged
void afterVariableChanged(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.- Specified by:
afterVariableChanged
in interfaceVariableListener<Entity_>
- Parameters:
scoreDirector
- never nullentity
- never null
-
beforeEntityRemoved
void beforeEntityRemoved(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.- Specified by:
beforeEntityRemoved
in interfaceVariableListener<Entity_>
- Parameters:
scoreDirector
- never nullentity
- never null
-
afterEntityRemoved
void afterEntityRemoved(ScoreDirector scoreDirector, Entity_ entity)
Deprecated.- Specified by:
afterEntityRemoved
in interfaceVariableListener<Entity_>
- Parameters:
scoreDirector
- never nullentity
- never null
-
-