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
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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractScoreInliner(Map<Constraint, Score_> constraintWeightMap, boolean constraintMatchEnabled) -
Method Summary
Modifier and TypeMethodDescriptionprotected final 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) final Map<String,ConstraintMatchTotal<Score_>> final Map<Object,Indictment<Score_>> boolean
-
Field Details
-
constraintMatchEnabled
protected final boolean constraintMatchEnabled -
constraintWeightMap
-
-
Constructor Details
-
AbstractScoreInliner
protected AbstractScoreInliner(Map<Constraint, Score_> constraintWeightMap, boolean constraintMatchEnabled)
-
-
Method Details
-
buildScoreInliner
public static <Score_ extends Score<Score_>,ScoreInliner_ extends AbstractScoreInliner<Score_>> ScoreInliner_ buildScoreInliner(ScoreDefinition<Score_> scoreDefinition, Map<Constraint, Score_> constraintWeightMap, boolean constraintMatchEnabled) -
extractScore
-
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() -
getConstraintIdToConstraintMatchTotalMap
-
getIndictmentMap
-