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 @NonNull 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> @NonNull UniConstraintStream<A>As defined byUniConstraintStream.ifExists(Class, BiJoiner).default <B> @NonNull UniConstraintStream<A>ifExistsIncludingUnassigned(@NonNull Class<B> otherClass, @NonNull BiJoiner<A, B>... joiners) default <B> @NonNull UniConstraintStream<A>ifNotExists(@NonNull Class<B> otherClass, @NonNull BiJoiner<A, B>... joiners) As defined byUniConstraintStream.ifNotExists(Class, BiJoiner).default <B> @NonNull UniConstraintStream<A>ifNotExistsIncludingUnassigned(@NonNull Class<B> otherClass, @NonNull BiJoiner<A, B>... joiners) default @NonNull ConstraintPositively or negatively impact theScoreby the constraintWeight for each match.default @NonNull Constraintimpact(@NonNull String constraintPackage, @NonNull String constraintName, @NonNull Score<?> constraintWeight) As defined byConstraintStream.impact(String, Score).default <Score_ extends Score<Score_>>
@NonNull UniConstraintBuilder<A,Score_> impact(@NonNull Score_ constraintWeight, @NonNull 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_>>
@NonNull UniConstraintBuilder<A,Score_> impactBigDecimal(@NonNull Score_ constraintWeight, @NonNull 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_>>
@NonNull UniConstraintBuilder<A,Score_> impactLong(@NonNull Score_ constraintWeight, @NonNull 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) default <B> @NonNull BiConstraintStream<A,B> As defined byUniConstraintStream.join(Class, BiJoiner).<B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoinerComber<A, B> joinerComber) AllowsConstraintFactory.forEachUniquePair(Class)to reuse the joiner combing logic.default @NonNull ConstraintNegatively impact theScore: subtract the constraintWeight for each match.default @NonNull Constraintpenalize(@NonNull String constraintPackage, @NonNull String constraintName, @NonNull Score<?> constraintWeight) As defined byConstraintStream.penalize(String, Score).default <Score_ extends Score<Score_>>
@NonNull UniConstraintBuilder<A,Score_> penalize(@NonNull Score_ constraintWeight, @NonNull 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_>>
@NonNull UniConstraintBuilder<A,Score_> penalizeBigDecimal(@NonNull Score_ constraintWeight, @NonNull Function<A, BigDecimal> matchWeigher) As defined byUniConstraintStream.penalize(Score, ToIntFunction), with a penalty of typeBigDecimal.default @NonNull ConstraintpenalizeConfigurable(@NonNull String constraintName) Negatively impact theScore: subtract theConstraintWeightfor each match.default @NonNull ConstraintpenalizeConfigurable(@NonNull String constraintPackage, @NonNull 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_>>
@NonNull UniConstraintBuilder<A,Score_> penalizeLong(@NonNull Score_ constraintWeight, @NonNull ToLongFunction<A> matchWeigher) As defined byUniConstraintStream.penalize(Score, ToIntFunction), with a penalty of type long.default @NonNull ConstraintPositively impact theScore: add the constraintWeight for each match.default @NonNull Constraintreward(@NonNull String constraintPackage, @NonNull String constraintName, @NonNull Score<?> constraintWeight) As defined byConstraintStream.reward(String, Score).default <Score_ extends Score<Score_>>
@NonNull UniConstraintBuilder<A,Score_> reward(@NonNull Score_ constraintWeight, @NonNull 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_>>
@NonNull UniConstraintBuilder<A,Score_> rewardBigDecimal(@NonNull Score_ constraintWeight, @NonNull Function<A, BigDecimal> matchWeigher) As defined byUniConstraintStream.reward(Score, ToIntFunction), with a penalty of typeBigDecimal.default @NonNull ConstraintrewardConfigurable(@NonNull String constraintName) Positively impact theScore: add theConstraintWeightfor each match.default @NonNull ConstraintrewardConfigurable(@NonNull String constraintPackage, @NonNull 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_>>
@NonNull UniConstraintBuilder<A,Score_> rewardLong(@NonNull Score_ constraintWeight, @NonNull 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
default <B> @NonNull BiConstraintStream<A,B> join(@NonNull Class<B> otherClass, @NonNull BiJoiner<A, B>... joiners) 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- Returns:
- 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
default <B> @NonNull UniConstraintStream<A> ifExists(@NonNull Class<B> otherClass, @NonNull BiJoiner<A, B>... joiners) 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- Returns:
- a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifExistsIncludingUnassigned
default <B> @NonNull UniConstraintStream<A> ifExistsIncludingUnassigned(@NonNull Class<B> otherClass, @NonNull 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- Returns:
- a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifNotExists
default <B> @NonNull UniConstraintStream<A> ifNotExists(@NonNull Class<B> otherClass, @NonNull BiJoiner<A, B>... joiners) 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- Returns:
- a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
ifNotExistsIncludingUnassigned
default <B> @NonNull UniConstraintStream<A> ifNotExistsIncludingUnassigned(@NonNull Class<B> otherClass, @NonNull 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- Returns:
- 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>
-
penalize
default <Score_ extends Score<Score_>> @NonNull UniConstraintBuilder<A,Score_> penalize(@NonNull Score_ constraintWeight, @NonNull 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>matchWeigher- the result of this function (matchWeight) is multiplied by the constraintWeight
-
penalizeLong
default <Score_ extends Score<Score_>> @NonNull UniConstraintBuilder<A,Score_> penalizeLong(@NonNull Score_ constraintWeight, @NonNull 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_>> @NonNull UniConstraintBuilder<A,Score_> penalizeBigDecimal(@NonNull Score_ constraintWeight, @NonNull 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_>> @NonNull UniConstraintBuilder<A,Score_> reward(@NonNull Score_ constraintWeight, @NonNull 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>matchWeigher- the result of this function (matchWeight) is multiplied by the constraintWeight
-
rewardLong
default <Score_ extends Score<Score_>> @NonNull UniConstraintBuilder<A,Score_> rewardLong(@NonNull Score_ constraintWeight, @NonNull 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_>> @NonNull UniConstraintBuilder<A,Score_> rewardBigDecimal(@NonNull Score_ constraintWeight, @NonNull 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_>> @NonNull UniConstraintBuilder<A,Score_> impact(@NonNull Score_ constraintWeight, @NonNull 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>matchWeigher- the result of this function (matchWeight) is multiplied by the constraintWeight
-
impactLong
default <Score_ extends Score<Score_>> @NonNull UniConstraintBuilder<A,Score_> impactLong(@NonNull Score_ constraintWeight, @NonNull 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_>> @NonNull UniConstraintBuilder<A,Score_> impactBigDecimal(@NonNull Score_ constraintWeight, @NonNull 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
default @NonNull Constraint penalize(@NonNull String constraintName, @NonNull Score<?> constraintWeight) 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- shows up inConstraintMatchTotalduring score justification
-
penalize
default @NonNull Constraint penalize(@NonNull String constraintPackage, @NonNull String constraintName, @NonNull Score<?> constraintWeight) Description copied from interface:ConstraintStreamAs defined byConstraintStream.penalize(String, Score).- Specified by:
penalizein interfaceConstraintStream
-
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- shows up inConstraintMatchTotalduring score justification
-
penalizeConfigurable
default @NonNull Constraint penalizeConfigurable(@NonNull String constraintPackage, @NonNull String constraintName) Description copied from interface:ConstraintStreamAs defined byConstraintStream.penalizeConfigurable(String).- Specified by:
penalizeConfigurablein interfaceConstraintStream
-
reward
default @NonNull Constraint reward(@NonNull String constraintName, @NonNull Score<?> constraintWeight) 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- shows up inConstraintMatchTotalduring score justification
-
reward
default @NonNull Constraint reward(@NonNull String constraintPackage, @NonNull String constraintName, @NonNull Score<?> constraintWeight) Description copied from interface:ConstraintStreamAs defined byConstraintStream.reward(String, Score).- Specified by:
rewardin interfaceConstraintStream
-
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- shows up inConstraintMatchTotalduring score justification
-
rewardConfigurable
default @NonNull Constraint rewardConfigurable(@NonNull String constraintPackage, @NonNull String constraintName) Description copied from interface:ConstraintStreamAs defined byConstraintStream.rewardConfigurable(String).- Specified by:
rewardConfigurablein interfaceConstraintStream
-
impact
default @NonNull Constraint impact(@NonNull String constraintName, @NonNull Score<?> constraintWeight) 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- shows up inConstraintMatchTotalduring score justification
-
impact
default @NonNull Constraint impact(@NonNull String constraintPackage, @NonNull String constraintName, @NonNull Score<?> constraintWeight) Description copied from interface:ConstraintStreamAs defined byConstraintStream.impact(String, Score).- Specified by:
impactin interfaceConstraintStream
-