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-
- All Implemented Interfaces:
BavetRootNode<A>
- Direct Known Subclasses:
ForEachFilteredUniNode,ForEachUnfilteredUniNode
@NullMarked
public abstract sealed class AbstractForEachUniNode<A>
extends AbstractNode
implements BavetRootNode<A>
permits ForEachFilteredUniNode<A>, ForEachUnfilteredUniNode<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 (
ForEachFilteredUniNode),
as opposed to forcing an extra filter node on the generic case (ForEachUnfilteredUniNode).-
Nested Class Summary
Nested classes/interfaces inherited from interface ai.timefold.solver.core.impl.bavet.common.BavetRootNode
BavetRootNode.LifecycleOperation -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractForEachUniNode(Class<A> forEachClass, TupleLifecycle<UniTuple<A>> nextNodesTupleLifecycle, int outputStoreSize) -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowsInstancesOf(Class<?> clazz) Instead of calling the propagation directly from here, we export the propagation queue and allowBavetConstraintSessionto call it.Class<?>[]voidvoidprotected voidretractExisting(@Nullable A a, UniTuple<A> tuple) final StringtoString()protected final voidupdateExisting(@Nullable A a, UniTuple<A> tuple) Methods inherited from class ai.timefold.solver.core.impl.bavet.common.AbstractNode
addLocationSet, getId, getLayerIndex, getLocationSet, setId, setLayerIndexMethods 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.BavetRootNode
supports, update
-
Field Details
-
tupleMap
-
-
Constructor Details
-
AbstractForEachUniNode
protected AbstractForEachUniNode(Class<A> forEachClass, TupleLifecycle<UniTuple<A>> nextNodesTupleLifecycle, int outputStoreSize)
-
-
Method Details
-
getStreamKind
- Specified by:
getStreamKindin classAbstractNode
-
allowsInstancesOf
- Specified by:
allowsInstancesOfin interfaceBavetRootNode<A>
-
getSourceClasses
- Specified by:
getSourceClassesin interfaceBavetRootNode<A>
-
insert
- Specified by:
insertin interfaceBavetRootNode<A>
-
updateExisting
-
retract
- Specified by:
retractin interfaceBavetRootNode<A>
-
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
-
toString
- Overrides:
toStringin classAbstractNode
-