Class BavetAbstractConstraintStream<Solution_>
java.lang.Object
ai.timefold.solver.core.impl.score.stream.common.AbstractConstraintStream<Solution_>
ai.timefold.solver.core.impl.bavet.common.BavetAbstractConstraintStream<Solution_>
- All Implemented Interfaces:
ConstraintStream,BavetStream
- Direct Known Subclasses:
BavetAbstractBiConstraintStream,BavetAbstractQuadConstraintStream,BavetAbstractTriConstraintStream,BavetAbstractUniConstraintStream
public abstract class BavetAbstractConstraintStream<Solution_>
extends AbstractConstraintStream<Solution_>
implements BavetStream
-
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 <Score_ extends Score<Score_>>
ConstraintbuildConstraint(String constraintPackage, String constraintName, String description, String constraintGroup, Score_ constraintWeight, ScoreImpactType impactType, Object justificationFunction, Object indictedObjectsMapping, BavetScoringConstraintStream<Solution_> stream) abstract <Score_ extends Score<Score_>>
voidbuildNode(ConstraintNodeBuildHelper<Solution_, Score_> buildHelper) voidcollectActiveConstraintStreams(Set<BavetAbstractConstraintStream<Solution_>> constraintStreamSet) @NonNull BavetConstraintFactory<Solution_>TheConstraintFactorythat build this.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.core.impl.score.stream.common.AbstractConstraintStream
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 <Score_ extends Score<Score_>> Constraint buildConstraint(String constraintPackage, String constraintName, String description, String constraintGroup, 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
public abstract <Score_ extends Score<Score_>> void buildNode(ConstraintNodeBuildHelper<Solution_, Score_> buildHelper) -
assertEmptyChildStreamList
protected void assertEmptyChildStreamList() -
getConstraintFactory
Description copied from interface:ConstraintStreamTheConstraintFactorythat build this.- Specified by:
getConstraintFactoryin interfaceConstraintStream- Specified by:
getConstraintFactoryin classAbstractConstraintStream<Solution_>
-
getParent
- Specified by:
getParentin interfaceBavetStream- Returns:
- null for join/ifExists nodes, which have left and right parents instead; also null for forEach node, which has no parent.
-
getChildStreamList
-