Class VariableTracker<Solution_>
java.lang.Object
ai.timefold.solver.core.impl.domain.variable.listener.support.violation.VariableTracker<Solution_>
- All Implemented Interfaces:
InnerBasicVariableListener<Solution_,,Object> InnerVariableListener<Solution_,,BasicVariableChangeEvent<Object>> SourcedBasicVariableListener<Solution_,,Object> SourcedVariableListener<Solution_,,BasicVariableChangeEvent<Object>> Supply,Closeable,AutoCloseable
public class VariableTracker<Solution_>
extends Object
implements SourcedBasicVariableListener<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 TypeMethodDescriptionvoidafterChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) voidbeforeChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) demand()getEntitiesMissingBeforeAfterEvents(List<VariableId<Solution_>> changedVariables) voidresetWorkingSolution(@NonNull InnerScoreDirector<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.impl.domain.variable.InnerVariableListener
close, requiresUniqueEntityEvents
-
Constructor Details
-
VariableTracker
-
-
Method Details
-
getSourceVariableDescriptor
- Specified by:
getSourceVariableDescriptorin interfaceSourcedVariableListener<Solution_,BasicVariableChangeEvent<Object>>
-
resetWorkingSolution
Description copied from interface:InnerVariableListenerCalled 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 interfaceInnerVariableListener<Solution_,BasicVariableChangeEvent<Object>>
-
beforeChange
public void beforeChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) - Specified by:
beforeChangein interfaceInnerVariableListener<Solution_,BasicVariableChangeEvent<Object>>
-
afterChange
public void afterChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) - Specified by:
afterChangein interfaceInnerVariableListener<Solution_,BasicVariableChangeEvent<Object>>
-
getEntitiesMissingBeforeAfterEvents
public List<String> getEntitiesMissingBeforeAfterEvents(List<VariableId<Solution_>> changedVariables) -
demand
-