Class AbstractJoinNode<LeftTuple_ extends AbstractTuple,Right_,OutTuple_ extends AbstractTuple>
- java.lang.Object
-
- ai.timefold.solver.constraint.streams.bavet.common.AbstractNode
-
- ai.timefold.solver.constraint.streams.bavet.common.AbstractJoinNode<LeftTuple_,Right_,OutTuple_>
-
- Type Parameters:
LeftTuple_-Right_-
- All Implemented Interfaces:
LeftTupleLifecycle<LeftTuple_>,RightTupleLifecycle<UniTuple<Right_>>
- Direct Known Subclasses:
AbstractIndexedJoinNode,AbstractUnindexedJoinNode
public abstract class AbstractJoinNode<LeftTuple_ extends AbstractTuple,Right_,OutTuple_ extends AbstractTuple> extends AbstractNode implements LeftTupleLifecycle<LeftTuple_>, RightTupleLifecycle<UniTuple<Right_>>
This class has two direct children:AbstractIndexedJoinNodeandAbstractUnindexedJoinNode. 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.
-
-
Field Summary
Fields Modifier and Type Field Description protected intinputStoreIndexLeftOutTupleListprotected intinputStoreIndexRightOutTupleList
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractJoinNode(int inputStoreIndexLeftOutTupleList, int inputStoreIndexRightOutTupleList, TupleLifecycle<OutTuple_> nextNodesTupleLifecycle, boolean isFiltering, int outputStoreIndexLeftOutEntry, int outputStoreIndexRightOutEntry)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract OutTuple_createOutTuple(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)PropagatorgetPropagator()Instead of calling the propagation directly from here, we export the propagation queue and allowBavetConstraintSessionto call it.protected voidinnerUpdateLeft(LeftTuple_ leftTuple, Consumer<Consumer<UniTuple<Right_>>> rightTupleConsumer)protected voidinnerUpdateRight(UniTuple<Right_> rightTuple, Consumer<Consumer<LeftTuple_>> leftTupleConsumer)protected voidinsertOutTuple(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)protected voidinsertOutTupleFiltered(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)protected voidretractOutTuple(OutTuple_ outTuple)protected abstract voidsetOutTupleLeftFacts(OutTuple_ outTuple, LeftTuple_ leftTuple)protected abstract voidsetOutTupleRightFact(OutTuple_ outTuple, UniTuple<Right_> rightTuple)protected abstract booleantestFiltering(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)-
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
-
AbstractJoinNode
protected AbstractJoinNode(int inputStoreIndexLeftOutTupleList, int inputStoreIndexRightOutTupleList, TupleLifecycle<OutTuple_> nextNodesTupleLifecycle, boolean isFiltering, int outputStoreIndexLeftOutEntry, int outputStoreIndexRightOutEntry)
-
-
Method Detail
-
createOutTuple
protected abstract OutTuple_ createOutTuple(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)
-
setOutTupleLeftFacts
protected abstract void setOutTupleLeftFacts(OutTuple_ outTuple, LeftTuple_ leftTuple)
-
setOutTupleRightFact
protected abstract void setOutTupleRightFact(OutTuple_ outTuple, UniTuple<Right_> rightTuple)
-
testFiltering
protected abstract boolean testFiltering(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)
-
insertOutTuple
protected final void insertOutTuple(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)
-
insertOutTupleFiltered
protected final void insertOutTupleFiltered(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)
-
innerUpdateLeft
protected final void innerUpdateLeft(LeftTuple_ leftTuple, Consumer<Consumer<UniTuple<Right_>>> rightTupleConsumer)
-
innerUpdateRight
protected final void innerUpdateRight(UniTuple<Right_> rightTuple, Consumer<Consumer<LeftTuple_>> leftTupleConsumer)
-
retractOutTuple
protected final void retractOutTuple(OutTuple_ outTuple)
-
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
-
-