Class SingletonInverseVariableListener<Solution_>
java.lang.Object
ai.timefold.solver.core.impl.domain.variable.inverserelation.SingletonInverseVariableListener<Solution_>
- All Implemented Interfaces:
InnerBasicVariableListener<Solution_,,Object> InnerVariableListener<Solution_,,BasicVariableChangeEvent<Object>> SingletonInverseVariableSupply,Supply,Closeable,AutoCloseable
public class SingletonInverseVariableListener<Solution_>
extends Object
implements InnerBasicVariableListener<Solution_,Object>, SingletonInverseVariableSupply
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final InverseRelationShadowVariableDescriptor<Solution_>protected final VariableDescriptor<Solution_> -
Constructor Summary
ConstructorsConstructorDescriptionSingletonInverseVariableListener(InverseRelationShadowVariableDescriptor<Solution_> shadowVariableDescriptor, VariableDescriptor<Solution_> sourceVariableDescriptor) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) voidbeforeChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) getInverseSingleton(Object planningValue) If entity1.varA = x then the inverse of x is entity1.protected voidinsert(InnerScoreDirector<Solution_, ?> scoreDirector, Object entity) voidresetWorkingSolution(InnerScoreDirector<Solution_, ?> scoreDirector) Called when the entire working solution changes.protected voidretract(InnerScoreDirector<Solution_, ?> scoreDirector, Object entity) 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
-
shadowVariableDescriptor
-
sourceVariableDescriptor
-
-
Constructor Details
-
SingletonInverseVariableListener
public SingletonInverseVariableListener(InverseRelationShadowVariableDescriptor<Solution_> shadowVariableDescriptor, VariableDescriptor<Solution_> sourceVariableDescriptor)
-
-
Method Details
-
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>>
-
insert
-
retract
-
getInverseSingleton
Description copied from interface:SingletonInverseVariableSupplyIf entity1.varA = x then the inverse of x is entity1.- Specified by:
getInverseSingletonin interfaceSingletonInverseVariableSupply- Parameters:
planningValue- never null- Returns:
- sometimes null, an entity for which the planning variable is the planningValue.
-