Interface WeightedScoreImpacter
-
public interface WeightedScoreImpacter
There are several valid ways how an impacter could be called from a constraint stream:.penalize(..., (int) 1)
.penalizeLong(..., (int) 1)
.penalizeLong(..., (long) 1)
.penalizeBigDecimal(..., (int) 1)
.penalizeBigDecimal(..., (long) 1)
.penalizeBigDecimal(..., BigDecimal.ONE)
- Plus reward variants of the above.
UnsupportedOperationException
for the method types it doesn't support. The CS API guarantees no types are mixed. For example, aBigDecimal
parameter method won't be called on an instance built with anWeightedScoreImpacter.IntImpactFunction
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
WeightedScoreImpacter.BigDecimalImpactFunction
static interface
WeightedScoreImpacter.IntImpactFunction
static interface
WeightedScoreImpacter.LongImpactFunction
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description UndoScoreImpacter
impactScore(int matchWeight, JustificationsSupplier justificationsSupplier)
UndoScoreImpacter
impactScore(long matchWeight, JustificationsSupplier justificationsSupplier)
UndoScoreImpacter
impactScore(BigDecimal matchWeight, JustificationsSupplier justificationsSupplier)
static WeightedScoreImpacter
of(WeightedScoreImpacter.BigDecimalImpactFunction impactFunction)
static WeightedScoreImpacter
of(WeightedScoreImpacter.IntImpactFunction impactFunction)
static WeightedScoreImpacter
of(WeightedScoreImpacter.LongImpactFunction impactFunction)
-
-
-
Method Detail
-
of
static WeightedScoreImpacter of(WeightedScoreImpacter.IntImpactFunction impactFunction)
-
of
static WeightedScoreImpacter of(WeightedScoreImpacter.LongImpactFunction impactFunction)
-
of
static WeightedScoreImpacter of(WeightedScoreImpacter.BigDecimalImpactFunction impactFunction)
-
impactScore
UndoScoreImpacter impactScore(int matchWeight, JustificationsSupplier justificationsSupplier)
- Parameters:
matchWeight
- never nulljustificationsSupplier
- never null- Returns:
- never null
-
impactScore
UndoScoreImpacter impactScore(long matchWeight, JustificationsSupplier justificationsSupplier)
- Parameters:
matchWeight
- never nulljustificationsSupplier
- never null- Returns:
- never null
-
impactScore
UndoScoreImpacter impactScore(BigDecimal matchWeight, JustificationsSupplier justificationsSupplier)
- Parameters:
matchWeight
- never nulljustificationsSupplier
- never null- Returns:
- never null
-
-