public abstract class AbstractConstraint<Solution_,ConstraintFactory extends InnerConstraintFactory<Solution_>> extends Object implements Constraint
Modifier and Type | Field and Description |
---|---|
protected ConstraintFactory |
constraintFactory |
protected String |
constraintName |
protected String |
constraintPackage |
protected ScoreImpactType |
scoreImpactType |
Modifier | Constructor and Description |
---|---|
protected |
AbstractConstraint(ConstraintFactory constraintFactory,
String constraintPackage,
String constraintName,
Function<Solution_,Score<?>> constraintWeightExtractor,
ScoreImpactType scoreImpactType,
boolean isConstraintWeightConfigurable) |
Modifier and Type | Method and Description |
---|---|
void |
assertCorrectImpact(BigDecimal impact) |
void |
assertCorrectImpact(int impact) |
void |
assertCorrectImpact(long impact) |
Score<?> |
extractConstraintWeight(Solution_ workingSolution) |
ConstraintFactory |
getConstraintFactory()
The
ConstraintFactory that build this. |
String |
getConstraintName()
The constraint name.
|
String |
getConstraintPackage()
The constraint package is the namespace of the constraint.
|
ScoreImpactType |
getScoreImpactType() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConstraintId
protected final ConstraintFactory extends InnerConstraintFactory<Solution_> constraintFactory
protected final String constraintPackage
protected final String constraintName
protected final ScoreImpactType scoreImpactType
protected AbstractConstraint(ConstraintFactory constraintFactory, String constraintPackage, String constraintName, Function<Solution_,Score<?>> constraintWeightExtractor, ScoreImpactType scoreImpactType, boolean isConstraintWeightConfigurable)
public void assertCorrectImpact(int impact)
public void assertCorrectImpact(long impact)
public void assertCorrectImpact(BigDecimal impact)
public ConstraintFactory getConstraintFactory()
Constraint
ConstraintFactory
that build this.getConstraintFactory
in interface Constraint
public String getConstraintPackage()
Constraint
When using a ConstraintConfiguration
,
it is equal to the ConstraintWeight.constraintPackage()
.
getConstraintPackage
in interface Constraint
public String getConstraintName()
Constraint
Constraint.getConstraintId()
is unique.
When using a ConstraintConfiguration
,
it is equal to the ConstraintWeight.value()
.
getConstraintName
in interface Constraint
public ScoreImpactType getScoreImpactType()
Copyright © 2006–2021 JBoss by Red Hat. All rights reserved.