public class DroolsConstraint<Solution_> extends Object implements Constraint
| Constructor and Description |
|---|
DroolsConstraint(DroolsConstraintFactory<Solution_> constraintFactory,
String constraintPackage,
String constraintName,
Function<Solution_,Score<?>> constraintWeightExtractor,
boolean positive,
List<DroolsFromUniConstraintStream<Solution_,Object>> fromStreamList,
DroolsAbstractConstraintStream<Solution_> scoringStream) |
| Modifier and Type | Method and Description |
|---|---|
org.drools.model.Rule |
createRule(org.drools.model.Global<? extends AbstractScoreHolder<?>> scoreHolderGlobal) |
Score<?> |
extractConstraintWeight(Solution_ workingSolution) |
DroolsConstraintFactory<Solution_> |
getConstraintFactory()
The
ConstraintFactory that build this. |
String |
getConstraintName()
The constraint name.
|
String |
getConstraintPackage()
The constraint package is the namespace of the constraint.
|
Class[] |
getExpectedJustificationTypes()
As defined by
DroolsRuleStructure.getExpectedJustificationTypes(). |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetConstraintIdpublic DroolsConstraint(DroolsConstraintFactory<Solution_> constraintFactory, String constraintPackage, String constraintName, Function<Solution_,Score<?>> constraintWeightExtractor, boolean positive, List<DroolsFromUniConstraintStream<Solution_,Object>> fromStreamList, DroolsAbstractConstraintStream<Solution_> scoringStream)
public org.drools.model.Rule createRule(org.drools.model.Global<? extends AbstractScoreHolder<?>> scoreHolderGlobal)
public DroolsConstraintFactory<Solution_> getConstraintFactory()
ConstraintConstraintFactory that build this.getConstraintFactory in interface Constraintpublic String getConstraintPackage()
Constraint
When using a ConstraintConfiguration,
it is equal to the ConstraintWeight.constraintPackage().
getConstraintPackage in interface Constraintpublic String getConstraintName()
ConstraintConstraint.getConstraintId() is unique.
When using a ConstraintConfiguration,
it is equal to the ConstraintWeight.value().
getConstraintName in interface Constraintpublic Class[] getExpectedJustificationTypes()
DroolsRuleStructure.getExpectedJustificationTypes().Copyright © 2006–2020 JBoss by Red Hat. All rights reserved.