Class AbstractIfExistsNode<LeftTuple_ extends AbstractTuple,Right_>
- java.lang.Object
-
- ai.timefold.solver.constraint.streams.bavet.common.AbstractNode
-
- ai.timefold.solver.constraint.streams.bavet.common.AbstractIfExistsNode<LeftTuple_,Right_>
-
- Type Parameters:
LeftTuple_-Right_-
- All Implemented Interfaces:
LeftTupleLifecycle<LeftTuple_>,RightTupleLifecycle<UniTuple<Right_>>
- Direct Known Subclasses:
AbstractIndexedIfExistsNode,AbstractUnindexedIfExistsNode
public abstract class AbstractIfExistsNode<LeftTuple_ extends AbstractTuple,Right_> extends AbstractNode implements LeftTupleLifecycle<LeftTuple_>, RightTupleLifecycle<UniTuple<Right_>>
This class has two direct children:AbstractIndexedIfExistsNodeandAbstractUnindexedIfExistsNode. The logic in either is identical, except that the latter removes all indexing work. Therefore any time that one of the classes changes, the other should be inspected if it could benefit from applying the change there too.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractIfExistsNode.FilteringTracker<LeftTuple_ extends AbstractTuple>
-
Field Summary
Fields Modifier and Type Field Description protected intinputStoreIndexLeftTrackerListprotected intinputStoreIndexRightTrackerListprotected booleanisFilteringprotected booleanshouldExist
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractIfExistsNode(boolean shouldExist, int inputStoreIndexLeftTrackerList, int inputStoreIndexRightTrackerList, TupleLifecycle<LeftTuple_> nextNodesTupleLifecycle, boolean isFiltering)
-
Method Summary
-
Methods inherited from class ai.timefold.solver.constraint.streams.bavet.common.AbstractNode
getLayerIndex, setId, setLayerIndex, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ai.timefold.solver.constraint.streams.bavet.common.tuple.LeftTupleLifecycle
insertLeft, retractLeft, updateLeft
-
Methods inherited from interface ai.timefold.solver.constraint.streams.bavet.common.tuple.RightTupleLifecycle
insertRight, retractRight, updateRight
-
-
-
-
Constructor Detail
-
AbstractIfExistsNode
protected AbstractIfExistsNode(boolean shouldExist, int inputStoreIndexLeftTrackerList, int inputStoreIndexRightTrackerList, TupleLifecycle<LeftTuple_> nextNodesTupleLifecycle, boolean isFiltering)
-
-
Method Detail
-
testFiltering
protected abstract boolean testFiltering(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)
-
initCounterLeft
protected void initCounterLeft(ExistsCounter<LeftTuple_> counter)
-
updateUnchangedCounterLeft
protected final void updateUnchangedCounterLeft(ExistsCounter<LeftTuple_> counter)
-
updateCounterLeft
protected void updateCounterLeft(ExistsCounter<LeftTuple_> counter)
-
killCounterLeft
protected void killCounterLeft(ExistsCounter<LeftTuple_> counter)
-
incrementCounterRight
protected void incrementCounterRight(ExistsCounter<LeftTuple_> counter)
-
decrementCounterRight
protected void decrementCounterRight(ExistsCounter<LeftTuple_> counter)
-
updateRightTrackerList
protected ElementAwareList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> updateRightTrackerList(UniTuple<Right_> rightTuple)
-
updateCounterFromLeft
protected void updateCounterFromLeft(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, ElementAwareList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> leftTrackerList)
-
updateCounterFromRight
protected void updateCounterFromRight(UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, ElementAwareList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> rightTrackerList)
-
getPropagator
public Propagator getPropagator()
Description copied from class:AbstractNodeInstead of calling the propagation directly from here, we export the propagation queue and allowBavetConstraintSessionto call it. This is done with the idea thatPropagatoronly has two implementations (unlikeAbstractNodewith myriad implementations) and therefore JVM call site optimizations will kick in to make the method dispatch faster.- Specified by:
getPropagatorin classAbstractNode- Returns:
- never null; the
PropagationQueuein use by this node
-
-