Class BavetAbstractConstraintStream<Solution_>
- java.lang.Object
-
- ai.timefold.solver.constraint.streams.common.AbstractConstraintStream<Solution_>
-
- ai.timefold.solver.constraint.streams.bavet.common.BavetAbstractConstraintStream<Solution_>
-
- All Implemented Interfaces:
ConstraintStream
- Direct Known Subclasses:
BavetAbstractBiConstraintStream,BavetAbstractQuadConstraintStream,BavetAbstractTriConstraintStream,BavetAbstractUniConstraintStream
public abstract class BavetAbstractConstraintStream<Solution_> extends AbstractConstraintStream<Solution_>
-
-
Field Summary
Fields Modifier and Type Field Description protected List<BavetAbstractConstraintStream<Solution_>>childStreamListprotected BavetConstraintFactory<Solution_>constraintFactoryprotected BavetAbstractConstraintStream<Solution_>parent
-
Constructor Summary
Constructors Modifier Constructor Description protectedBavetAbstractConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, BavetAbstractConstraintStream<Solution_> parent)protectedBavetAbstractConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidassertEmptyChildStreamList()protected ConstraintbuildConstraint(String constraintPackage, String constraintName, Score<?> constraintWeight, ScoreImpactType impactType, Object justificationFunction, Object indictedObjectsMapping, BavetScoringConstraintStream<Solution_> stream)abstract <Score_ extends Score<Score_>>
voidbuildNode(NodeBuildHelper<Score_> buildHelper)voidcollectActiveConstraintStreams(Set<BavetAbstractConstraintStream<Solution_>> constraintStreamSet)List<BavetAbstractConstraintStream<Solution_>>getChildStreamList()BavetConstraintFactory<Solution_>getConstraintFactory()BavetAbstractConstraintStream<Solution_>getParent()BavetAbstractConstraintStream<Solution_>getTupleSource()Returns the stream which first produced the tuple that this stream operates on.booleanguaranteesDistinct()Whether the stream guarantees that no two tuples it produces will ever have the same set of facts.<Stream_ extends BavetAbstractConstraintStream<Solution_>>
Stream_shareAndAddChild(Stream_ stream)-
Methods inherited from class ai.timefold.solver.constraint.streams.common.AbstractConstraintStream
buildConstraintWeightExtractor, buildConstraintWeightExtractor, getDefaultIndictedObjectsMapping, getDefaultJustificationMapping, getRetrievalSemantics
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ai.timefold.solver.core.api.score.stream.ConstraintStream
impact, impact, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable
-
-
-
-
Field Detail
-
constraintFactory
protected final BavetConstraintFactory<Solution_> constraintFactory
-
parent
protected final BavetAbstractConstraintStream<Solution_> parent
-
childStreamList
protected final List<BavetAbstractConstraintStream<Solution_>> childStreamList
-
-
Constructor Detail
-
BavetAbstractConstraintStream
protected BavetAbstractConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, BavetAbstractConstraintStream<Solution_> parent)
-
BavetAbstractConstraintStream
protected BavetAbstractConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics)
-
-
Method Detail
-
guaranteesDistinct
public boolean guaranteesDistinct()
Whether the stream guarantees that no two tuples it produces will ever have the same set of facts. Streams which can prove that they either do or do not produce unique tuples should override this method.- Returns:
- delegates to
getParent()if not null, otherwise false
-
buildConstraint
protected Constraint buildConstraint(String constraintPackage, String constraintName, Score<?> constraintWeight, ScoreImpactType impactType, Object justificationFunction, Object indictedObjectsMapping, BavetScoringConstraintStream<Solution_> stream)
-
shareAndAddChild
public final <Stream_ extends BavetAbstractConstraintStream<Solution_>> Stream_ shareAndAddChild(Stream_ stream)
-
collectActiveConstraintStreams
public void collectActiveConstraintStreams(Set<BavetAbstractConstraintStream<Solution_>> constraintStreamSet)
-
getTupleSource
public BavetAbstractConstraintStream<Solution_> getTupleSource()
Returns the stream which first produced the tuple that this stream operates on. If a stream does not have a single parent nor is it a source, it is expected to override this method.- Returns:
- this if
TupleSource, otherwise parent's tuple source.
-
buildNode
public abstract <Score_ extends Score<Score_>> void buildNode(NodeBuildHelper<Score_> buildHelper)
-
assertEmptyChildStreamList
protected void assertEmptyChildStreamList()
-
getConstraintFactory
public BavetConstraintFactory<Solution_> getConstraintFactory()
- Specified by:
getConstraintFactoryin interfaceConstraintStream- Specified by:
getConstraintFactoryin classAbstractConstraintStream<Solution_>
-
getParent
public final BavetAbstractConstraintStream<Solution_> getParent()
- Returns:
- null for join/ifExists nodes, which have left and right parents instead; also null for forEach node, which has no parent.
-
getChildStreamList
public final List<BavetAbstractConstraintStream<Solution_>> getChildStreamList()
-
-