Class AbstractIfExistsNode<LeftTuple_ extends Tuple,Right_>
java.lang.Object
ai.timefold.solver.core.impl.bavet.common.AbstractNode
ai.timefold.solver.core.impl.bavet.common.AbstractTwoInputNode<LeftTuple_,UniTuple<Right_>>
ai.timefold.solver.core.impl.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 Tuple,Right_>
extends AbstractTwoInputNode<LeftTuple_,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, TupleLifecycle<LeftTuple_> nextNodesTupleLifecycle, boolean isFiltering, InTupleStorePositionTracker tupleStorePositionTracker) -
Method Summary
Modifier and TypeMethodDescriptionclearRightTrackerList(UniTuple<Right_> rightTuple) protected 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(ExistsCounter<LeftTuple_> counter, UniTuple<Right_> rightTuple, ElementAwareLinkedList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> leftTrackerList) protected voidupdateCounterFromRight(ExistsCounter<LeftTuple_> counter, UniTuple<Right_> rightTuple, ElementAwareLinkedList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> rightTrackerList) protected voidupdateCounterLeft(ExistsCounter<LeftTuple_> counter) protected final voidMethods inherited from class ai.timefold.solver.core.impl.bavet.common.AbstractNode
addLocationSet, getId, getLayerIndex, getLocationSet, 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.core.impl.bavet.common.tuple.LeftTupleLifecycle
insertLeft, retractLeft, updateLeftMethods inherited from interface ai.timefold.solver.core.impl.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, TupleLifecycle<LeftTuple_> nextNodesTupleLifecycle, boolean isFiltering, InTupleStorePositionTracker tupleStorePositionTracker)
-
-
Method Details
-
getStreamKind
- Specified by:
getStreamKindin classAbstractNode
-
testFiltering
-
initCounterLeft
-
updateUnchangedCounterLeft
-
updateCounterLeft
-
killCounterLeft
-
incrementCounterRight
-
decrementCounterRight
-
clearRightTrackerList
protected ElementAwareLinkedList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> clearRightTrackerList(UniTuple<Right_> rightTuple) -
updateCounterFromLeft
protected void updateCounterFromLeft(ExistsCounter<LeftTuple_> counter, UniTuple<Right_> rightTuple, ElementAwareLinkedList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> leftTrackerList) -
updateCounterFromRight
protected void updateCounterFromRight(ExistsCounter<LeftTuple_> counter, UniTuple<Right_> rightTuple, ElementAwareLinkedList<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
-