Class BiConstraintBuilderImpl<A,B,Score_ extends Score<Score_>>
java.lang.Object
ai.timefold.solver.core.impl.score.stream.common.AbstractConstraintBuilder<Score_>
ai.timefold.solver.core.impl.score.stream.common.bi.BiConstraintBuilderImpl<A,B,Score_>
- All Implemented Interfaces:
BiConstraintBuilder<A,,B, Score_> ConstraintBuilder
public final class BiConstraintBuilderImpl<A,B,Score_ extends Score<Score_>>
extends AbstractConstraintBuilder<Score_>
implements BiConstraintBuilder<A,B,Score_>
-
Constructor Summary
ConstructorsConstructorDescriptionBiConstraintBuilderImpl(BiConstraintConstructor<A, B, Score_> constraintConstructor, ScoreImpactType impactType, Score_ constraintWeight) -
Method Summary
Modifier and TypeMethodDescriptionprotected BiFunction<A,B, Collection<Object>> protected TriFunction<A,B, Score_, ConstraintJustification> indictWith(BiFunction<A, B, Collection<Object>> indictedObjectsMapping) Sets a custom function to mark any object returned by it as responsible for causing the constraint to match.<ConstraintJustification_ extends ConstraintJustification>
BiConstraintBuilder<A,B, Score_> justifyWith(TriFunction<A, B, Score_, ConstraintJustification_> justificationMapping) Sets a custom function to apply on a constraint match to justify it.Methods inherited from class ai.timefold.solver.core.impl.score.stream.common.AbstractConstraintBuilder
asConstraint, asConstraintDescribedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.timefold.solver.core.api.score.stream.ConstraintBuilder
asConstraint, asConstraint, asConstraintDescribed, asConstraintDescribed
-
Constructor Details
-
BiConstraintBuilderImpl
public BiConstraintBuilderImpl(BiConstraintConstructor<A, B, Score_> constraintConstructor, ScoreImpactType impactType, Score_ constraintWeight)
-
-
Method Details
-
getJustificationMapping
- Specified by:
getJustificationMappingin classAbstractConstraintBuilder<Score_ extends Score<Score_>>
-
justifyWith
public <ConstraintJustification_ extends ConstraintJustification> BiConstraintBuilder<A,B, justifyWithScore_> (TriFunction<A, B, Score_, ConstraintJustification_> justificationMapping) Description copied from interface:BiConstraintBuilderSets a custom function to apply on a constraint match to justify it.- Specified by:
justifyWithin interfaceBiConstraintBuilder<A,B, Score_ extends Score<Score_>> - Parameters:
justificationMapping- never null- Returns:
- this
- See Also:
-
getIndictedObjectsMapping
- Specified by:
getIndictedObjectsMappingin classAbstractConstraintBuilder<Score_ extends Score<Score_>>
-
indictWith
public BiConstraintBuilder<A,B, indictWithScore_> (BiFunction<A, B, Collection<Object>> indictedObjectsMapping) Description copied from interface:BiConstraintBuilderSets a custom function to mark any object returned by it as responsible for causing the constraint to match. Each object in the collection returned by this function will become anIndictmentand be available as a key inScoreExplanation.getIndictmentMap().- Specified by:
indictWithin interfaceBiConstraintBuilder<A,B, Score_ extends Score<Score_>> - Parameters:
indictedObjectsMapping- never null- Returns:
- this
-