Class ExternalizedAnchorVariableSupply<Solution_>
java.lang.Object
ai.timefold.solver.core.impl.domain.variable.anchor.ExternalizedAnchorVariableSupply<Solution_>
- All Implemented Interfaces:
AnchorVariableSupply,InnerBasicVariableListener<Solution_,,Object> InnerVariableListener<Solution_,,BasicVariableChangeEvent<Object>> SourcedBasicVariableListener<Solution_,,Object> SourcedVariableListener<Solution_,,BasicVariableChangeEvent<Object>> Supply,Closeable,AutoCloseable
@NullMarked
public class ExternalizedAnchorVariableSupply<Solution_>
extends Object
implements SourcedBasicVariableListener<Solution_,Object>, AnchorVariableSupply
Alternative to
AnchorVariableListener.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final SingletonInverseVariableSupplyprotected final VariableDescriptor<Solution_> -
Constructor Summary
ConstructorsConstructorDescriptionExternalizedAnchorVariableSupply(VariableDescriptor<Solution_> previousVariableDescriptor, SingletonInverseVariableSupply nextVariableSupply, Consumer<Object> notifier) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) voidbeforeChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) voidclose()Called before thisInnerVariableListeneris thrown away and not used anymore.@Nullable Objectprotected voidvoidresetWorkingSolution(InnerScoreDirector<Solution_, ?> scoreDirector) Called when the entire working solution changes.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.timefold.solver.core.impl.domain.variable.InnerVariableListener
requiresUniqueEntityEvents
-
Field Details
-
previousVariableDescriptor
-
nextVariableSupply
-
anchorMap
-
-
Constructor Details
-
ExternalizedAnchorVariableSupply
public ExternalizedAnchorVariableSupply(VariableDescriptor<Solution_> previousVariableDescriptor, SingletonInverseVariableSupply nextVariableSupply, Consumer<Object> notifier)
-
-
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>>
-
close
public void close()Description copied from interface:InnerVariableListenerCalled before thisInnerVariableListeneris thrown away and not used anymore.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceInnerVariableListener<Solution_,BasicVariableChangeEvent<Object>>
-
insert
-
getAnchor
- Specified by:
getAnchorin interfaceAnchorVariableSupply- Parameters:
entity- never null- Returns:
- sometimes null, the anchor for the entity
-
toString
-