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
FieldsModifier and TypeFieldDescriptionprotected final List<BavetAbstractConstraintStream<Solution_>>protected final BavetConstraintFactory<Solution_>protected final BavetAbstractConstraintStream<Solution_> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBavetAbstractConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, BavetAbstractConstraintStream<Solution_> parent) protectedBavetAbstractConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected 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) Returns the stream which first produced the tuple that this stream operates on.booleanWhether the stream guarantees that no two tuples it produces will ever have the same set of facts.final <Stream_ extends BavetAbstractConstraintStream<Solution_>>
Stream_shareAndAddChild(Stream_ stream) Methods inherited from class ai.timefold.solver.constraint.streams.common.AbstractConstraintStream
buildConstraintWeightExtractor, buildConstraintWeightExtractor, getDefaultIndictedObjectsMapping, getDefaultJustificationMapping, getRetrievalSemanticsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.timefold.solver.core.api.score.stream.ConstraintStream
impact, impact, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable
-
Field Details
-
constraintFactory
-
parent
-
childStreamList
-
-
Constructor Details
-
BavetAbstractConstraintStream
protected BavetAbstractConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, BavetAbstractConstraintStream<Solution_> parent) -
BavetAbstractConstraintStream
protected BavetAbstractConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics)
-
-
Method Details
-
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) -
collectActiveConstraintStreams
public void collectActiveConstraintStreams(Set<BavetAbstractConstraintStream<Solution_>> constraintStreamSet) -
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
-
assertEmptyChildStreamList
protected void assertEmptyChildStreamList() -
getConstraintFactory
- Specified by:
getConstraintFactoryin interfaceConstraintStream- Specified by:
getConstraintFactoryin classAbstractConstraintStream<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
-