Class ListVariableTracker<Solution_>
java.lang.Object
ai.timefold.solver.core.impl.domain.variable.listener.support.violation.ListVariableTracker<Solution_>
- All Implemented Interfaces:
InnerListVariableListener<Solution_,,Object, Object> InnerVariableListener<Solution_,,ListElementsChangeEvent<Object>> SourcedListVariableListener<Solution_,,Object, Object> SourcedVariableListener<Solution_,,ListElementsChangeEvent<Object>> Supply,Closeable,AutoCloseable
@NullMarked
public class ListVariableTracker<Solution_>
extends Object
implements SourcedListVariableListener<Solution_,Object,Object>, Supply
Tracks variable listener events for a given
PlanningListVariable.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassIn order for theListVariableTrackerto 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, ListElementsChangeEvent<Object> event) voidafterListElementUnassigned(InnerScoreDirector<Solution_, ?> scoreDirector, Object unassignedElement) voidbeforeChange(InnerScoreDirector<Solution_, ?> scoreDirector, ListElementsChangeEvent<Object> event) demand()getEntitiesMissingBeforeAfterEvents(List<VariableId<Solution_>> changedVariables) voidresetWorkingSolution(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
-
ListVariableTracker
-
-
Method Details
-
getSourceVariableDescriptor
- Specified by:
getSourceVariableDescriptorin interfaceSourcedVariableListener<Solution_,ListElementsChangeEvent<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_,ListElementsChangeEvent<Object>>
-
beforeChange
public void beforeChange(InnerScoreDirector<Solution_, ?> scoreDirector, ListElementsChangeEvent<Object> event) - Specified by:
beforeChangein interfaceInnerVariableListener<Solution_,ListElementsChangeEvent<Object>>
-
afterChange
public void afterChange(InnerScoreDirector<Solution_, ?> scoreDirector, ListElementsChangeEvent<Object> event) - Specified by:
afterChangein interfaceInnerVariableListener<Solution_,ListElementsChangeEvent<Object>>
-
getEntitiesMissingBeforeAfterEvents
public List<String> getEntitiesMissingBeforeAfterEvents(List<VariableId<Solution_>> changedVariables) -
demand
-
afterListElementUnassigned
public void afterListElementUnassigned(InnerScoreDirector<Solution_, ?> scoreDirector, Object unassignedElement) - Specified by:
afterListElementUnassignedin interfaceInnerListVariableListener<Solution_,Object, Object>
-