Class AbstractGroupNode<InTuple_ extends AbstractTuple,OutTuple_ extends AbstractTuple,GroupKey_,ResultContainer_,Result_>
- java.lang.Object
-
- ai.timefold.solver.constraint.streams.bavet.common.AbstractNode
-
- ai.timefold.solver.constraint.streams.bavet.common.AbstractGroupNode<InTuple_,OutTuple_,GroupKey_,ResultContainer_,Result_>
-
- All Implemented Interfaces:
TupleLifecycle<InTuple_>
public abstract class AbstractGroupNode<InTuple_ extends AbstractTuple,OutTuple_ extends AbstractTuple,GroupKey_,ResultContainer_,Result_> extends AbstractNode implements TupleLifecycle<InTuple_>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractGroupNode(int groupStoreIndex, int undoStoreIndex, Function<InTuple_,GroupKey_> groupKeyFunction, Supplier<ResultContainer_> supplier, Function<ResultContainer_,Result_> finisher, TupleLifecycle<OutTuple_> nextNodesTupleLifecycle, EnvironmentMode environmentMode)protectedAbstractGroupNode(int groupStoreIndex, Function<InTuple_,GroupKey_> groupKeyFunction, TupleLifecycle<OutTuple_> nextNodesTupleLifecycle, EnvironmentMode environmentMode)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Runnableaccumulate(ResultContainer_ resultContainer, InTuple_ tuple)protected abstract OutTuple_createOutTuple(GroupKey_ groupKey)PropagatorgetPropagator()Instead of calling the propagation directly from here, we export the propagation queue and allowBavetConstraintSessionto call it.voidinsert(InTuple_ tuple)voidretract(InTuple_ tuple)voidupdate(InTuple_ tuple)protected abstract voidupdateOutTupleToResult(OutTuple_ outTuple, Result_ result)-
Methods inherited from class ai.timefold.solver.constraint.streams.bavet.common.AbstractNode
getLayerIndex, setId, setLayerIndex, toString
-
-
-
-
Constructor Detail
-
AbstractGroupNode
protected AbstractGroupNode(int groupStoreIndex, int undoStoreIndex, Function<InTuple_,GroupKey_> groupKeyFunction, Supplier<ResultContainer_> supplier, Function<ResultContainer_,Result_> finisher, TupleLifecycle<OutTuple_> nextNodesTupleLifecycle, EnvironmentMode environmentMode)
-
AbstractGroupNode
protected AbstractGroupNode(int groupStoreIndex, Function<InTuple_,GroupKey_> groupKeyFunction, TupleLifecycle<OutTuple_> nextNodesTupleLifecycle, EnvironmentMode environmentMode)
-
-
Method Detail
-
insert
public final void insert(InTuple_ tuple)
- Specified by:
insertin interfaceTupleLifecycle<InTuple_ extends AbstractTuple>
-
update
public final void update(InTuple_ tuple)
- Specified by:
updatein interfaceTupleLifecycle<InTuple_ extends AbstractTuple>
-
retract
public final void retract(InTuple_ tuple)
- Specified by:
retractin interfaceTupleLifecycle<InTuple_ extends AbstractTuple>
-
accumulate
protected abstract Runnable accumulate(ResultContainer_ resultContainer, InTuple_ tuple)
-
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
-
createOutTuple
protected abstract OutTuple_ createOutTuple(GroupKey_ groupKey)
- Parameters:
groupKey- null if the node only has one group- Returns:
- never null
-
-