Class AbstractForEachUniNode<A>
java.lang.Object
ai.timefold.solver.core.impl.bavet.common.AbstractNode
ai.timefold.solver.core.impl.bavet.uni.AbstractForEachUniNode<A>
- Type Parameters:
A-
- Direct Known Subclasses:
ForEachExcludingPinnedUniNode,ForEachExcludingUnassignedUniNode,ForEachIncludingUnassignedUniNode
@NullMarked
public abstract sealed class AbstractForEachUniNode<A>
extends AbstractNode
permits ForEachExcludingUnassignedUniNode<A>, ForEachExcludingPinnedUniNode<Solution_,A>, ForEachIncludingUnassignedUniNode<A>
Filtering nodes are expensive.
Considering that most streams start with a nullity check on genuine planning variables,
it makes sense to create a specialized version of the node for this case (
ForEachExcludingUnassignedUniNode),
as opposed to forcing an extra filter node on the generic case (ForEachIncludingUnassignedUniNode).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic enumRepresents the various lifecycle operations that can be performed on tuples within a node in Bavet. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractForEachUniNode(Class<A> forEachClass, TupleLifecycle<UniTuple<A>> nextNodesTupleLifecycle, int outputStoreSize) -
Method Summary
Modifier and TypeMethodDescriptionInstead of calling the propagation directly from here, we export the propagation queue and allowBavetConstraintSessionto call it.voidvoidprotected voidretractExisting(A a, UniTuple<A> tuple) abstract booleansupports(AbstractForEachUniNode.LifecycleOperation lifecycleOperation) Determines if this node supports the given lifecycle operation.final StringtoString()abstract voidprotected final voidupdateExisting(A a, UniTuple<A> tuple) Methods inherited from class ai.timefold.solver.core.impl.bavet.common.AbstractNode
getId, getLayerIndex, setId, setLayerIndex
-
Field Details
-
tupleMap
-
-
Constructor Details
-
AbstractForEachUniNode
protected AbstractForEachUniNode(Class<A> forEachClass, TupleLifecycle<UniTuple<A>> nextNodesTupleLifecycle, int outputStoreSize)
-
-
Method Details
-
insert
-
update
-
updateExisting
-
retract
-
retractExisting
-
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
-
getForEachClass
-
supports
Determines if this node supports the given lifecycle operation. Unsupported nodes will not be called during that lifecycle operation.- Parameters:
lifecycleOperation- the lifecycle operation to check- Returns:
trueif the given lifecycle operation is supported; otherwise,false.
-
toString
- Overrides:
toStringin classAbstractNode
-