Class AbstractScoreInliner<Score_ extends Score<Score_>>
- java.lang.Object
-
- ai.timefold.solver.constraint.streams.common.inliner.AbstractScoreInliner<Score_>
-
- Type Parameters:
Score_-
- Direct Known Subclasses:
BendableLongScoreInliner
public abstract class AbstractScoreInliner<Score_ extends Score<Score_>> extends Object
Keeps track of the working score and constraint matches for a single constraint session. Every time constraint weights change, a new instance needs to be created.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanconstraintMatchEnabledprotected Map<Constraint,Score_>constraintWeightMap
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractScoreInliner(Map<Constraint,Score_> constraintWeightMap, boolean constraintMatchEnabled)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected UndoScoreImpacteraddConstraintMatch(Constraint constraint, Score_ score, ConstraintMatchSupplier<Score_> constraintMatchSupplier, UndoScoreImpacter undoScoreImpact)static <Score_ extends Score<Score_>,ScoreInliner_ extends AbstractScoreInliner<Score_>>
ScoreInliner_buildScoreInliner(ScoreDefinition<Score_> scoreDefinition, Map<Constraint,Score_> constraintWeightMap, boolean constraintMatchEnabled)abstract WeightedScoreImpacter<Score_,?>buildWeightedScoreImpacter(AbstractConstraint<?,?,?> constraint)Create a new instance ofWeightedScoreImpacterfor a particular constraint.abstract Score_extractScore(int initScore)Map<String,ConstraintMatchTotal<Score_>>getConstraintMatchTotalMap()Map<Object,Indictment<Score_>>getIndictmentMap()booleanisConstraintMatchEnabled()
-
-
-
Field Detail
-
constraintMatchEnabled
protected final boolean constraintMatchEnabled
-
constraintWeightMap
protected final Map<Constraint,Score_ extends Score<Score_>> constraintWeightMap
-
-
Constructor Detail
-
AbstractScoreInliner
protected AbstractScoreInliner(Map<Constraint,Score_> constraintWeightMap, boolean constraintMatchEnabled)
-
-
Method Detail
-
buildScoreInliner
public static <Score_ extends Score<Score_>,ScoreInliner_ extends AbstractScoreInliner<Score_>> ScoreInliner_ buildScoreInliner(ScoreDefinition<Score_> scoreDefinition, Map<Constraint,Score_> constraintWeightMap, boolean constraintMatchEnabled)
-
extractScore
public abstract Score_ extractScore(int initScore)
-
buildWeightedScoreImpacter
public abstract WeightedScoreImpacter<Score_,?> buildWeightedScoreImpacter(AbstractConstraint<?,?,?> constraint)
Create a new instance ofWeightedScoreImpacterfor a particular constraint.- Parameters:
constraint- never null- Returns:
- never null
-
addConstraintMatch
protected final UndoScoreImpacter addConstraintMatch(Constraint constraint, Score_ score, ConstraintMatchSupplier<Score_> constraintMatchSupplier, UndoScoreImpacter undoScoreImpact)
-
isConstraintMatchEnabled
public boolean isConstraintMatchEnabled()
-
getConstraintMatchTotalMap
public final Map<String,ConstraintMatchTotal<Score_>> getConstraintMatchTotalMap()
-
getIndictmentMap
public final Map<Object,Indictment<Score_>> getIndictmentMap()
-
-