Class DroolsAbstractConstraintStream<Solution_,​LHS_ extends org.optaplanner.constraint.streams.drools.common.AbstractLeftHandSide>

    • Constructor Detail

      • DroolsAbstractConstraintStream

        public DroolsAbstractConstraintStream​(DroolsConstraintFactory<Solution_> constraintFactory,
                                              org.optaplanner.constraint.streams.common.RetrievalSemantics retrievalSemantics)
    • Method Detail

      • buildConstraint

        protected org.optaplanner.core.api.score.stream.Constraint buildConstraint​(String constraintPackage,
                                                                                   String constraintName,
                                                                                   org.optaplanner.core.api.score.Score<?> constraintWeight,
                                                                                   org.optaplanner.constraint.streams.common.ScoreImpactType impactType,
                                                                                   Object justificationMapping,
                                                                                   Object indictedObjectsMapping,
                                                                                   RuleBuilder<Solution_> ruleBuilder)
      • getConstraintFactory

        public DroolsConstraintFactory<Solution_> getConstraintFactory()
        Specified by:
        getConstraintFactory in interface org.optaplanner.core.api.score.stream.ConstraintStream
        Specified by:
        getConstraintFactory in class org.optaplanner.constraint.streams.common.AbstractConstraintStream<Solution_>
      • createLeftHandSide

        public abstract LHS_ 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 of AbstractLeftHandSide must 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