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:
AbstractIndexedIfExistsNode and AbstractUnindexedIfExistsNode.
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 ClassesModifier and TypeClassDescriptionprotected static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final intprotected final booleanprotected final boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractIfExistsNode(boolean shouldExist, int inputStoreIndexLeftTrackerList, int inputStoreIndexRightTrackerList, TupleLifecycle<LeftTuple_> nextNodesTupleLifecycle, boolean isFiltering) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecrementCounterRight(ExistsCounter<LeftTuple_> counter) Instead of calling the propagation directly from here, we export the propagation queue and allowBavetConstraintSessionto call it.protected voidincrementCounterRight(ExistsCounter<LeftTuple_> counter) protected voidinitCounterLeft(ExistsCounter<LeftTuple_> counter) protected voidkillCounterLeft(ExistsCounter<LeftTuple_> counter) protected abstract booleantestFiltering(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple) protected voidupdateCounterFromLeft(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, ElementAwareList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> leftTrackerList) protected voidupdateCounterFromRight(UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, ElementAwareList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> rightTrackerList) protected voidupdateCounterLeft(ExistsCounter<LeftTuple_> counter) updateRightTrackerList(UniTuple<Right_> rightTuple) protected final voidMethods inherited from class ai.timefold.solver.constraint.streams.bavet.common.AbstractNode
getLayerIndex, setId, setLayerIndex, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.timefold.solver.constraint.streams.bavet.common.tuple.LeftTupleLifecycle
insertLeft, retractLeft, updateLeftMethods inherited from interface ai.timefold.solver.constraint.streams.bavet.common.tuple.RightTupleLifecycle
insertRight, retractRight, updateRight
-
Field Details
-
shouldExist
protected final boolean shouldExist -
inputStoreIndexLeftTrackerList
protected final int inputStoreIndexLeftTrackerList -
inputStoreIndexRightTrackerList
protected final int inputStoreIndexRightTrackerList -
isFiltering
protected final boolean isFiltering
-
-
Constructor Details
-
AbstractIfExistsNode
protected AbstractIfExistsNode(boolean shouldExist, int inputStoreIndexLeftTrackerList, int inputStoreIndexRightTrackerList, TupleLifecycle<LeftTuple_> nextNodesTupleLifecycle, boolean isFiltering)
-
-
Method Details
-
testFiltering
-
initCounterLeft
-
updateUnchangedCounterLeft
-
updateCounterLeft
-
killCounterLeft
-
incrementCounterRight
-
decrementCounterRight
-
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
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
-