Class AnchorVariableListener<Solution_,Entity_>
java.lang.Object
ai.timefold.solver.core.impl.domain.variable.anchor.AnchorVariableListener<Solution_,Entity_>
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
- All Implemented Interfaces:
AnchorVariableSupply,InnerBasicVariableListener<Solution_,,Entity_> InnerVariableListener<Solution_,,BasicVariableChangeEvent<Entity_>> Supply,Closeable,AutoCloseable
@NullMarked
public class AnchorVariableListener<Solution_,Entity_>
extends Object
implements InnerBasicVariableListener<Solution_,Entity_>, AnchorVariableSupply
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnchorShadowVariableDescriptor<Solution_>protected final SingletonInverseVariableSupplyprotected final VariableDescriptor<Solution_> -
Constructor Summary
ConstructorsConstructorDescriptionAnchorVariableListener(AnchorShadowVariableDescriptor<Solution_> anchorShadowVariableDescriptor, VariableDescriptor<Solution_> previousVariableDescriptor, SingletonInverseVariableSupply nextVariableSupply) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Entity_> event) voidbeforeChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Entity_> event) protected voidinsert(InnerScoreDirector<Solution_, ?> scoreDirector, Object entity) 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
-
Field Details
-
anchorShadowVariableDescriptor
-
previousVariableDescriptor
-
nextVariableSupply
-
-
Constructor Details
-
AnchorVariableListener
public AnchorVariableListener(AnchorShadowVariableDescriptor<Solution_> anchorShadowVariableDescriptor, VariableDescriptor<Solution_> previousVariableDescriptor, SingletonInverseVariableSupply nextVariableSupply)
-
-
Method Details
-
beforeChange
public void beforeChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Entity_> event) - Specified by:
beforeChangein interfaceInnerVariableListener<Solution_,Entity_>
-
afterChange
public void afterChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Entity_> event) - Specified by:
afterChangein interfaceInnerVariableListener<Solution_,Entity_>
-
insert
-
getAnchor
- Specified by:
getAnchorin interfaceAnchorVariableSupply- Parameters:
entity- never null- Returns:
- sometimes null, the anchor for the entity
-
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_,Entity_>
-