Class DroolsAbstractConstraintStream<Solution_,LHS_ extends org.optaplanner.constraint.streams.drools.common.AbstractLeftHandSide>
java.lang.Object
org.optaplanner.constraint.streams.common.AbstractConstraintStream<Solution_>
org.optaplanner.constraint.streams.drools.common.DroolsAbstractConstraintStream<Solution_,LHS_>
- All Implemented Interfaces:
ConstraintStream
- Direct Known Subclasses:
DroolsAbstractBiConstraintStream,DroolsAbstractQuadConstraintStream,DroolsAbstractTriConstraintStream,DroolsAbstractUniConstraintStream
public abstract class DroolsAbstractConstraintStream<Solution_,LHS_ extends org.optaplanner.constraint.streams.drools.common.AbstractLeftHandSide>
extends AbstractConstraintStream<Solution_>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDroolsAbstractConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildStream(DroolsAbstractConstraintStream<Solution_, ?> childStream) protected ConstraintbuildConstraint(String constraintPackage, String constraintName, Score<?> constraintWeight, ScoreImpactType impactType, Object justificationMapping, Object indictedObjectsMapping, RuleBuilder<Solution_> ruleBuilder) abstract LHS_Some constructs in the Drools executable model may not be reused between different rules.Methods inherited from class org.optaplanner.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 org.optaplanner.core.api.score.stream.ConstraintStream
impact, impact, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable
-
Field Details
-
constraintFactory
-
-
Constructor Details
-
DroolsAbstractConstraintStream
public DroolsAbstractConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics)
-
-
Method Details
-
buildConstraint
protected Constraint buildConstraint(String constraintPackage, String constraintName, Score<?> constraintWeight, ScoreImpactType impactType, Object justificationMapping, Object indictedObjectsMapping, RuleBuilder<Solution_> ruleBuilder) -
addChildStream
-
getChildStreams
-
getConstraintFactory
- Specified by:
getConstraintFactoryin interfaceConstraintStream- Specified by:
getConstraintFactoryin classAbstractConstraintStream<Solution_>
-
createLeftHandSide
Some constructs in the Drools executable model may not be reused between different rules. They are, among others, variable instances and beta indexes. Therefore an instance ofAbstractLeftHandSidemust never be used to create more than one rule. Therefore every constraint stream re-creates the entire chain of left hand sides every time a new rule is built. It is then left up to Drools to node-share everything it can.- Returns:
- never null, different instance on every call
-