Class VariableTracker<Solution_>
java.lang.Object
ai.timefold.solver.core.impl.domain.variable.listener.support.violation.VariableTracker<Solution_>
- All Implemented Interfaces:
AbstractVariableListener<Solution_,,Object> VariableListener<Solution_,,Object> SourcedVariableListener<Solution_>,Supply,Closeable,AutoCloseable
public class VariableTracker<Solution_>
extends Object
implements SourcedVariableListener<Solution_>, VariableListener<Solution_,Object>, Supply
Tracks variable listener events for a given genuine or shadow variable
(except
PlanningListVariable).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassIn order for theVariableTrackerto be registered as a variable listener, it needs to be passed to theInnerScoreDirector.getSupplyManager(), which requires aDemand. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterEntityAdded(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object object) voidafterEntityRemoved(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object object) voidafterVariableChanged(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object entity) voidbeforeEntityAdded(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object object) voidbeforeEntityRemoved(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object object) voidbeforeVariableChanged(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object entity) demand()getEntitiesMissingBeforeAfterEvents(List<VariableId<Solution_>> changedVariables) voidresetWorkingSolution(@NonNull ScoreDirector<Solution_> scoreDirector) Called when the entire working solution changes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.timefold.solver.core.api.domain.variable.AbstractVariableListener
closeMethods inherited from interface ai.timefold.solver.core.api.domain.variable.VariableListener
requiresUniqueEntityEvents
-
Constructor Details
-
VariableTracker
-
-
Method Details
-
getSourceVariableDescriptor
- Specified by:
getSourceVariableDescriptorin interfaceSourcedVariableListener<Solution_>
-
beforeEntityAdded
public void beforeEntityAdded(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object object) - Specified by:
beforeEntityAddedin interfaceAbstractVariableListener<Solution_,Object>
-
afterEntityAdded
public void afterEntityAdded(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object object) - Specified by:
afterEntityAddedin interfaceAbstractVariableListener<Solution_,Object>
-
beforeEntityRemoved
public void beforeEntityRemoved(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object object) - Specified by:
beforeEntityRemovedin interfaceAbstractVariableListener<Solution_,Object>
-
afterEntityRemoved
public void afterEntityRemoved(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object object) - Specified by:
afterEntityRemovedin interfaceAbstractVariableListener<Solution_,Object>
-
resetWorkingSolution
Description copied from interface:AbstractVariableListenerCalled when the entire working solution changes. In this event, the other before..()/after...() methods will not be called. At this point, implementations should clear state, if any.- Specified by:
resetWorkingSolutionin interfaceAbstractVariableListener<Solution_,Object>
-
beforeVariableChanged
public void beforeVariableChanged(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object entity) - Specified by:
beforeVariableChangedin interfaceVariableListener<Solution_,Object>
-
afterVariableChanged
public void afterVariableChanged(@NonNull ScoreDirector<Solution_> scoreDirector, @NonNull Object entity) - Specified by:
afterVariableChangedin interfaceVariableListener<Solution_,Object>
-
getEntitiesMissingBeforeAfterEvents
public List<String> getEntitiesMissingBeforeAfterEvents(List<VariableId<Solution_>> changedVariables) -
demand
-