Interface InnerUniConstraintStream<A>
- All Superinterfaces:
ConstraintStream,UniConstraintStream<A>
- All Known Implementing Classes:
BavetAbstractUniConstraintStream,BavetAftBridgeUniConstraintStream,BavetForEachUniConstraintStream,BavetForeBridgeUniConstraintStream,BavetUniConcatUniConstraintStream
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A> Function<A,Collection<?>> static <A> BiFunction<A,Score<?>, DefaultConstraintJustification> default UniConstraintStream<A>distinct()Transforms the stream in such a way that all the tuples going through it are distinct.booleanThis method returns true if the constraint stream is guaranteed to only produce distinct tuples.default <B> UniConstraintStream<A>As defined byUniConstraintStream.ifExists(Class, BiJoiner).default <B> UniConstraintStream<A>ifExistsIncludingUnassigned(Class<B> otherClass, BiJoiner<A, B>... joiners) default <B> UniConstraintStream<A>ifNotExists(Class<B> otherClass, BiJoiner<A, B>... joiners) As defined byUniConstraintStream.ifNotExists(Class, BiJoiner).default <B> UniConstraintStream<A>ifNotExistsIncludingUnassigned(Class<B> otherClass, BiJoiner<A, B>... joiners) default ConstraintPositively or negatively impact theScoreby the constraintWeight for each match.default ConstraintAs defined byConstraintStream.impact(String, Score).default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> impact(Score_ constraintWeight, ToIntFunction<A> matchWeigher) Positively or negatively impacts theScoreby constraintWeight multiplied by matchWeight for each match and returns a builder to apply optional constraint properties.default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> impactBigDecimal(Score_ constraintWeight, Function<A, BigDecimal> matchWeigher) As defined byUniConstraintStream.impact(Score, ToIntFunction), with an impact of typeBigDecimal.default UniConstraintBuilder<A,?> impactConfigurable(ToIntFunction<A> matchWeigher) Positively impacts theScoreby theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.default UniConstraintBuilder<A,?> impactConfigurableBigDecimal(Function<A, BigDecimal> matchWeigher) As defined byUniConstraintStream.impactConfigurable(ToIntFunction), with an impact of type BigDecimal.default UniConstraintBuilder<A,?> impactConfigurableLong(ToLongFunction<A> matchWeigher) As defined byUniConstraintStream.impactConfigurable(ToIntFunction), with an impact of type long.default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> impactLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher) As defined byUniConstraintStream.impact(Score, ToIntFunction), with an impact of type long.<Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, Function<A, BigDecimal> matchWeigher, ScoreImpactType scoreImpactType) <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, ToIntFunction<A> matchWeigher, ScoreImpactType scoreImpactType) <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, ToLongFunction<A> matchWeigher, ScoreImpactType scoreImpactType) <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoinerComber<A, B> joinerComber) AllowsConstraintFactory.forEachUniquePair(Class)to reuse the joiner combing logic.default <B> BiConstraintStream<A,B> As defined byUniConstraintStream.join(Class, BiJoiner).default ConstraintNegatively impact theScore: subtract the constraintWeight for each match.default ConstraintAs defined byConstraintStream.penalize(String, Score).default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> penalize(Score_ constraintWeight, ToIntFunction<A> matchWeigher) Applies a negativeScoreimpact, subtracting the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> penalizeBigDecimal(Score_ constraintWeight, Function<A, BigDecimal> matchWeigher) As defined byUniConstraintStream.penalize(Score, ToIntFunction), with a penalty of typeBigDecimal.default ConstraintpenalizeConfigurable(String constraintName) Negatively impact theScore: subtract theConstraintWeightfor each match.default ConstraintpenalizeConfigurable(String constraintPackage, String constraintName) As defined byConstraintStream.penalizeConfigurable(String).default UniConstraintBuilder<A,?> penalizeConfigurable(ToIntFunction<A> matchWeigher) Negatively impacts theScore, subtracting theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.default UniConstraintBuilder<A,?> penalizeConfigurableBigDecimal(Function<A, BigDecimal> matchWeigher) As defined byUniConstraintStream.penalizeConfigurable(ToIntFunction), with a penalty of typeBigDecimal.default UniConstraintBuilder<A,?> penalizeConfigurableLong(ToLongFunction<A> matchWeigher) As defined byUniConstraintStream.penalizeConfigurable(ToIntFunction), with a penalty of type long.default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> penalizeLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher) As defined byUniConstraintStream.penalize(Score, ToIntFunction), with a penalty of type long.default ConstraintPositively impact theScore: add the constraintWeight for each match.default ConstraintAs defined byConstraintStream.reward(String, Score).default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> reward(Score_ constraintWeight, ToIntFunction<A> matchWeigher) Applies a positiveScoreimpact, adding the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> rewardBigDecimal(Score_ constraintWeight, Function<A, BigDecimal> matchWeigher) As defined byUniConstraintStream.reward(Score, ToIntFunction), with a penalty of typeBigDecimal.default ConstraintrewardConfigurable(String constraintName) Positively impact theScore: add theConstraintWeightfor each match.default ConstraintrewardConfigurable(String constraintPackage, String constraintName) As defined byConstraintStream.rewardConfigurable(String).default UniConstraintBuilder<A,?> rewardConfigurable(ToIntFunction<A> matchWeigher) Positively impacts theScore, adding theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.default UniConstraintBuilder<A,?> rewardConfigurableBigDecimal(Function<A, BigDecimal> matchWeigher) As defined byUniConstraintStream.rewardConfigurable(ToIntFunction), with a penalty of typeBigDecimal.default UniConstraintBuilder<A,?> rewardConfigurableLong(ToLongFunction<A> matchWeigher) As defined byUniConstraintStream.rewardConfigurable(ToIntFunction), with a penalty of type long.default <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> rewardLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher) As defined byUniConstraintStream.reward(Score, ToIntFunction), with a penalty of type long.Methods inherited from interface ai.timefold.solver.core.api.score.stream.ConstraintStream
getConstraintFactoryMethods inherited from interface ai.timefold.solver.core.api.score.stream.uni.UniConstraintStream
complement, concat, concat, concat, concat, concat, concat, concat, expand, expand, expand, filter, flattenLast, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, ifExists, ifExists, ifExists, ifExists, ifExists, ifExists, ifExists, ifExists, ifExists, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingUnassigned, ifExistsIncludingUnassigned, ifExistsIncludingUnassigned, ifExistsIncludingUnassigned, ifExistsOther, ifExistsOther, ifExistsOther, ifExistsOther, ifExistsOther, ifExistsOther, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingUnassigned, ifExistsOtherIncludingUnassigned, ifExistsOtherIncludingUnassigned, ifExistsOtherIncludingUnassigned, ifExistsOtherIncludingUnassigned, ifExistsOtherIncludingUnassigned, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingUnassigned, ifNotExistsIncludingUnassigned, ifNotExistsIncludingUnassigned, ifNotExistsIncludingUnassigned, ifNotExistsOther, ifNotExistsOther, ifNotExistsOther, ifNotExistsOther, ifNotExistsOther, ifNotExistsOther, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingUnassigned, ifNotExistsOtherIncludingUnassigned, ifNotExistsOtherIncludingUnassigned, ifNotExistsOtherIncludingUnassigned, ifNotExistsOtherIncludingUnassigned, ifNotExistsOtherIncludingUnassigned, impact, impact, impact, impactBigDecimal, impactBigDecimal, impactConfigurable, impactConfigurable, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableBigDecimal, impactConfigurableLong, impactConfigurableLong, impactLong, impactLong, join, join, join, join, join, join, join, join, join, join, join, map, map, map, map, penalize, penalize, penalize, penalizeBigDecimal, penalizeBigDecimal, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurable, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeConfigurableLong, penalizeLong, penalizeLong, penalizeLong, reward, reward, reward, rewardBigDecimal, rewardBigDecimal, rewardConfigurable, rewardConfigurable, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardConfigurableLong, rewardLong, rewardLong
-
Method Details
-
createDefaultJustificationMapping
static <A> BiFunction<A,Score<?>, createDefaultJustificationMapping()DefaultConstraintJustification> -
createDefaultIndictedObjectsMapping
-
getRetrievalSemantics
RetrievalSemantics getRetrievalSemantics() -
guaranteesDistinct
boolean guaranteesDistinct()This method returns true if the constraint stream is guaranteed to only produce distinct tuples. Seedistinct()for details.- Returns:
- true if the guarantee of distinct tuples is provided
-
join
Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.join(Class, BiJoiner). For performance reasons, the indexing joiners must be placed before filtering joiners.This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoinerparameters.- Specified by:
joinin interfaceUniConstraintStream<A>- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every combination of A and B for which all the
joinersare true
-
join
<B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoinerComber<A, B> joinerComber) AllowsConstraintFactory.forEachUniquePair(Class)to reuse the joiner combing logic.- Type Parameters:
B-- Parameters:
otherStream- never nulljoinerComber- never null- Returns:
- never null
-
ifExists
Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.ifExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoinerparameters.- Specified by:
ifExistsin interfaceUniConstraintStream<A>- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifExistsIncludingUnassigned
default <B> UniConstraintStream<A> ifExistsIncludingUnassigned(Class<B> otherClass, BiJoiner<A, B>... joiners) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.ifExistsIncludingUnassigned(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoinerparameters.- Specified by:
ifExistsIncludingUnassignedin interfaceUniConstraintStream<A>- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifNotExists
Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.ifNotExists(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoinerparameters.- Specified by:
ifNotExistsin interfaceUniConstraintStream<A>- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
ifNotExistsIncludingUnassigned
default <B> UniConstraintStream<A> ifNotExistsIncludingUnassigned(Class<B> otherClass, BiJoiner<A, B>... joiners) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.ifNotExistsIncludingUnassigned(Class, BiJoiner). For performance reasons, indexing joiners must be placed before filtering joiners.This method causes Unchecked generics array creation for varargs parameter warnings, but we can't fix it with a
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoinerparameters.- Specified by:
ifNotExistsIncludingUnassignedin interfaceUniConstraintStream<A>- Type Parameters:
B- the type of the second matched fact- Parameters:
otherClass- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
distinct
Description copied from interface:UniConstraintStreamTransforms the stream in such a way that all the tuples going through it are distinct. (No two tuples willequal.)By default, tuples going through a constraint stream are distinct. However, operations such as
UniConstraintStream.map(Function)may create a stream which breaks that promise. By calling this method on such a stream, duplicate copies of the same tuple will be omitted at a performance cost.- Specified by:
distinctin interfaceUniConstraintStream<A>- Returns:
- never null
-
penalize
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> penalize(Score_ constraintWeight, ToIntFunction<A> matchWeigher) Description copied from interface:UniConstraintStreamApplies a negativeScoreimpact, subtracting the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.The constraintWeight specified here can be overridden using
ConstraintWeightOverrideson thePlanningSolution-annotated classFor non-int
Scoretypes useUniConstraintStream.penalizeLong(Score, ToLongFunction)orUniConstraintStream.penalizeBigDecimal(Score, Function)instead.- Specified by:
penalizein interfaceUniConstraintStream<A>- Parameters:
constraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
penalizeLong
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> penalizeLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.penalize(Score, ToIntFunction), with a penalty of type long.- Specified by:
penalizeLongin interfaceUniConstraintStream<A>
-
penalizeBigDecimal
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> penalizeBigDecimal(Score_ constraintWeight, Function<A, BigDecimal> matchWeigher) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.penalize(Score, ToIntFunction), with a penalty of typeBigDecimal.- Specified by:
penalizeBigDecimalin interfaceUniConstraintStream<A>
-
penalizeConfigurable
Description copied from interface:UniConstraintStreamNegatively impacts theScore, subtracting theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero.- Specified by:
penalizeConfigurablein interfaceUniConstraintStream<A>- Parameters:
matchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
penalizeConfigurableLong
Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.penalizeConfigurable(ToIntFunction), with a penalty of type long.- Specified by:
penalizeConfigurableLongin interfaceUniConstraintStream<A>
-
penalizeConfigurableBigDecimal
default UniConstraintBuilder<A,?> penalizeConfigurableBigDecimal(Function<A, BigDecimal> matchWeigher) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.penalizeConfigurable(ToIntFunction), with a penalty of typeBigDecimal.- Specified by:
penalizeConfigurableBigDecimalin interfaceUniConstraintStream<A>
-
reward
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> reward(Score_ constraintWeight, ToIntFunction<A> matchWeigher) Description copied from interface:UniConstraintStreamApplies a positiveScoreimpact, adding the constraintWeight multiplied by the match weight, and returns a builder to apply optional constraint properties.The constraintWeight specified here can be overridden using
ConstraintWeightOverrideson thePlanningSolution-annotated classFor non-int
Scoretypes useUniConstraintStream.rewardLong(Score, ToLongFunction)orUniConstraintStream.rewardBigDecimal(Score, Function)instead.- Specified by:
rewardin interfaceUniConstraintStream<A>- Parameters:
constraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
rewardLong
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> rewardLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.reward(Score, ToIntFunction), with a penalty of type long.- Specified by:
rewardLongin interfaceUniConstraintStream<A>
-
rewardBigDecimal
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> rewardBigDecimal(Score_ constraintWeight, Function<A, BigDecimal> matchWeigher) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.reward(Score, ToIntFunction), with a penalty of typeBigDecimal.- Specified by:
rewardBigDecimalin interfaceUniConstraintStream<A>
-
rewardConfigurable
Description copied from interface:UniConstraintStreamPositively impacts theScore, adding theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero.- Specified by:
rewardConfigurablein interfaceUniConstraintStream<A>- Parameters:
matchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
rewardConfigurableLong
Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.rewardConfigurable(ToIntFunction), with a penalty of type long.- Specified by:
rewardConfigurableLongin interfaceUniConstraintStream<A>
-
rewardConfigurableBigDecimal
Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.rewardConfigurable(ToIntFunction), with a penalty of typeBigDecimal.- Specified by:
rewardConfigurableBigDecimalin interfaceUniConstraintStream<A>
-
impact
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> impact(Score_ constraintWeight, ToIntFunction<A> matchWeigher) Description copied from interface:UniConstraintStreamPositively or negatively impacts theScoreby constraintWeight multiplied by matchWeight for each match and returns a builder to apply optional constraint properties.The constraintWeight specified here can be overridden using
ConstraintWeightOverrideson thePlanningSolution-annotated classUse
penalize(...)orreward(...)instead, unless this constraint can both have positive and negative weights.- Specified by:
impactin interfaceUniConstraintStream<A>- Parameters:
constraintWeight- never nullmatchWeigher- never null, the result of this function (matchWeight) is multiplied by the constraintWeight- Returns:
- never null
-
impactLong
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> impactLong(Score_ constraintWeight, ToLongFunction<A> matchWeigher) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.impact(Score, ToIntFunction), with an impact of type long.- Specified by:
impactLongin interfaceUniConstraintStream<A>
-
impactBigDecimal
default <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> impactBigDecimal(Score_ constraintWeight, Function<A, BigDecimal> matchWeigher) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.impact(Score, ToIntFunction), with an impact of typeBigDecimal.- Specified by:
impactBigDecimalin interfaceUniConstraintStream<A>
-
impactConfigurable
Description copied from interface:UniConstraintStreamPositively impacts theScoreby theConstraintWeightmultiplied by match weight for each match, and returns a builder to apply optional constraint properties.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero.- Specified by:
impactConfigurablein interfaceUniConstraintStream<A>- Returns:
- never null
-
impactConfigurableLong
Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.impactConfigurable(ToIntFunction), with an impact of type long.- Specified by:
impactConfigurableLongin interfaceUniConstraintStream<A>
-
impactConfigurableBigDecimal
Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.impactConfigurable(ToIntFunction), with an impact of type BigDecimal.- Specified by:
impactConfigurableBigDecimalin interfaceUniConstraintStream<A>
-
innerImpact
<Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, ToIntFunction<A> matchWeigher, ScoreImpactType scoreImpactType) -
innerImpact
<Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, ToLongFunction<A> matchWeigher, ScoreImpactType scoreImpactType) -
innerImpact
<Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, Function<A, BigDecimal> matchWeigher, ScoreImpactType scoreImpactType) -
penalize
Description copied from interface:ConstraintStreamNegatively impact theScore: subtract the constraintWeight for each match.To avoid hard-coding the constraintWeight, to allow end-users to tweak it, use
ConstraintStream.penalizeConfigurable(String)and aConstraintConfigurationinstead.The
constraint packagedefaults to the package of thePlanningSolutionclass.- Specified by:
penalizein interfaceConstraintStream- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never null- Returns:
- never null
-
penalize
default Constraint penalize(String constraintPackage, String constraintName, Score<?> constraintWeight) Description copied from interface:ConstraintStreamAs defined byConstraintStream.penalize(String, Score).- Specified by:
penalizein interfaceConstraintStream- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never null- Returns:
- never null
-
penalizeConfigurable
Description copied from interface:ConstraintStreamNegatively impact theScore: subtract theConstraintWeightfor each match.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero.The
constraint packagedefaults toConstraintConfiguration.constraintPackage().- Specified by:
penalizeConfigurablein interfaceConstraintStream- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justification- Returns:
- never null
-
penalizeConfigurable
Description copied from interface:ConstraintStreamAs defined byConstraintStream.penalizeConfigurable(String).- Specified by:
penalizeConfigurablein interfaceConstraintStream- Parameters:
constraintPackage- never nullconstraintName- never null- Returns:
- never null
-
reward
Description copied from interface:ConstraintStreamPositively impact theScore: add the constraintWeight for each match.To avoid hard-coding the constraintWeight, to allow end-users to tweak it, use
ConstraintStream.penalizeConfigurable(String)and aConstraintConfigurationinstead.The
constraint packagedefaults to the package of thePlanningSolutionclass.- Specified by:
rewardin interfaceConstraintStream- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never null- Returns:
- never null
-
reward
default Constraint reward(String constraintPackage, String constraintName, Score<?> constraintWeight) Description copied from interface:ConstraintStreamAs defined byConstraintStream.reward(String, Score).- Specified by:
rewardin interfaceConstraintStream- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never null- Returns:
- never null
-
rewardConfigurable
Description copied from interface:ConstraintStreamPositively impact theScore: add theConstraintWeightfor each match.The constraintWeight comes from an
ConstraintWeightannotated member on theConstraintConfiguration, so end users can change the constraint weights dynamically. This constraint may be deactivated if theConstraintWeightis zero.The
constraint packagedefaults toConstraintConfiguration.constraintPackage().- Specified by:
rewardConfigurablein interfaceConstraintStream- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justification- Returns:
- never null
-
rewardConfigurable
Description copied from interface:ConstraintStreamAs defined byConstraintStream.rewardConfigurable(String).- Specified by:
rewardConfigurablein interfaceConstraintStream- Parameters:
constraintPackage- never nullconstraintName- never null- Returns:
- never null
-
impact
Description copied from interface:ConstraintStreamPositively or negatively impact theScoreby the constraintWeight for each match.Use
penalize(...)orreward(...)instead, unless this constraint can both have positive and negative weights.The
constraint packagedefaults to the package of thePlanningSolutionclass.- Specified by:
impactin interfaceConstraintStream- Parameters:
constraintName- never null, shows up inConstraintMatchTotalduring score justificationconstraintWeight- never null- Returns:
- never null
-
impact
default Constraint impact(String constraintPackage, String constraintName, Score<?> constraintWeight) Description copied from interface:ConstraintStreamAs defined byConstraintStream.impact(String, Score).- Specified by:
impactin interfaceConstraintStream- Parameters:
constraintPackage- never nullconstraintName- never nullconstraintWeight- never null- Returns:
- never null
-