Class ExperimentalConstraintCollectors
java.lang.Object
ai.timefold.solver.examples.common.experimental.ExperimentalConstraintCollectors
A collection of experimental constraint collectors subject to change in future versions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A,B, C, D, IntervalType_, PointType_ extends Comparable<PointType_>, DifferenceType_ extends Comparable<DifferenceType_>>
ai.timefold.solver.core.api.score.stream.quad.QuadConstraintCollector<A,B, C, D, IntervalTree<IntervalType_, PointType_, DifferenceType_>, ConsecutiveIntervalInfo<IntervalType_, PointType_, DifferenceType_>> consecutiveIntervals(ai.timefold.solver.core.api.function.QuadFunction<A, B, C, D, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap, BiFunction<PointType_, PointType_, DifferenceType_> differenceFunction) As defined byconsecutiveIntervals(Function,Function,BiFunction).static <A,B, C, D, IntervalType_>
ai.timefold.solver.core.api.score.stream.quad.QuadConstraintCollector<A,B, C, D, IntervalTree<IntervalType_, Long, Long>, ConsecutiveIntervalInfo<IntervalType_, Long, Long>> consecutiveIntervals(ai.timefold.solver.core.api.function.QuadFunction<A, B, C, D, IntervalType_> intervalMap, ToLongFunction<IntervalType_> startMap, ToLongFunction<IntervalType_> endMap) As defined byconsecutiveIntervals(ToLongFunction, ToLongFunction).static <A,B, C, IntervalType_, PointType_ extends Comparable<PointType_>, DifferenceType_ extends Comparable<DifferenceType_>>
ai.timefold.solver.core.api.score.stream.tri.TriConstraintCollector<A,B, C, IntervalTree<IntervalType_, PointType_, DifferenceType_>, ConsecutiveIntervalInfo<IntervalType_, PointType_, DifferenceType_>> consecutiveIntervals(ai.timefold.solver.core.api.function.TriFunction<A, B, C, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap, BiFunction<PointType_, PointType_, DifferenceType_> differenceFunction) As defined byconsecutiveIntervals(Function,Function,BiFunction).static <A,B, C, IntervalType_>
ai.timefold.solver.core.api.score.stream.tri.TriConstraintCollector<A,B, C, IntervalTree<IntervalType_, Long, Long>, ConsecutiveIntervalInfo<IntervalType_, Long, Long>> consecutiveIntervals(ai.timefold.solver.core.api.function.TriFunction<A, B, C, IntervalType_> intervalMap, ToLongFunction<IntervalType_> startMap, ToLongFunction<IntervalType_> endMap) As defined byconsecutiveIntervals(ToLongFunction, ToLongFunction).static <A,B, IntervalType_, PointType_ extends Comparable<PointType_>, DifferenceType_ extends Comparable<DifferenceType_>>
ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector<A,B, IntervalTree<IntervalType_, PointType_, DifferenceType_>, ConsecutiveIntervalInfo<IntervalType_, PointType_, DifferenceType_>> consecutiveIntervals(BiFunction<A, B, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap, BiFunction<PointType_, PointType_, DifferenceType_> differenceFunction) As defined byconsecutiveIntervals(Function,Function,BiFunction).static <A,B, IntervalType_>
ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector<A,B, IntervalTree<IntervalType_, Long, Long>, ConsecutiveIntervalInfo<IntervalType_, Long, Long>> consecutiveIntervals(BiFunction<A, B, IntervalType_> intervalMap, ToLongFunction<IntervalType_> startMap, ToLongFunction<IntervalType_> endMap) As defined byconsecutiveIntervals(ToLongFunction, ToLongFunction).static <A,PointType_ extends Comparable<PointType_>, DifferenceType_ extends Comparable<DifferenceType_>>
ai.timefold.solver.core.api.score.stream.uni.UniConstraintCollector<A,IntervalTree<A, PointType_, DifferenceType_>, ConsecutiveIntervalInfo<A, PointType_, DifferenceType_>> consecutiveIntervals(Function<A, PointType_> startMap, Function<A, PointType_> endMap, BiFunction<PointType_, PointType_, DifferenceType_> differenceFunction) Creates a constraint collector that returnsConsecutiveIntervalInfoabout the first fact.static <A> ai.timefold.solver.core.api.score.stream.uni.UniConstraintCollector<A,IntervalTree<A, Long, Long>, ConsecutiveIntervalInfo<A, Long, Long>> consecutiveIntervals(ToLongFunction<A> startMap, ToLongFunction<A> endMap) Specialized version ofconsecutiveIntervals(Function,Function,BiFunction)for Long.static <A,B, C, D, IntervalType_, PointType_ extends Temporal & Comparable<PointType_>>
ai.timefold.solver.core.api.score.stream.quad.QuadConstraintCollector<A,B, C, D, IntervalTree<IntervalType_, PointType_, Duration>, ConsecutiveIntervalInfo<IntervalType_, PointType_, Duration>> consecutiveTemporalIntervals(ai.timefold.solver.core.api.function.QuadFunction<A, B, C, D, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap) As defined byconsecutiveTemporalIntervals(Function,Function).static <A,B, C, IntervalType_, PointType_ extends Temporal & Comparable<PointType_>>
ai.timefold.solver.core.api.score.stream.tri.TriConstraintCollector<A,B, C, IntervalTree<IntervalType_, PointType_, Duration>, ConsecutiveIntervalInfo<IntervalType_, PointType_, Duration>> consecutiveTemporalIntervals(ai.timefold.solver.core.api.function.TriFunction<A, B, C, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap) As defined byconsecutiveTemporalIntervals(Function,Function).static <A,B, IntervalType_, PointType_ extends Temporal & Comparable<PointType_>>
ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector<A,B, IntervalTree<IntervalType_, PointType_, Duration>, ConsecutiveIntervalInfo<IntervalType_, PointType_, Duration>> consecutiveTemporalIntervals(BiFunction<A, B, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap) As defined byconsecutiveTemporalIntervals(Function,Function).static <A,PointType_ extends Temporal & Comparable<PointType_>>
ai.timefold.solver.core.api.score.stream.uni.UniConstraintCollector<A,IntervalTree<A, PointType_, Duration>, ConsecutiveIntervalInfo<A, PointType_, Duration>> consecutiveTemporalIntervals(Function<A, PointType_> startMap, Function<A, PointType_> endMap) Specialized version ofconsecutiveIntervals(Function,Function,BiFunction)forTemporaltypes.
-
Method Details
-
consecutiveIntervals
public static <A,PointType_ extends Comparable<PointType_>, ai.timefold.solver.core.api.score.stream.uni.UniConstraintCollector<A,DifferenceType_ extends Comparable<DifferenceType_>> IntervalTree<A, consecutiveIntervalsPointType_, DifferenceType_>, ConsecutiveIntervalInfo<A, PointType_, DifferenceType_>> (Function<A, PointType_> startMap, Function<A, PointType_> endMap, BiFunction<PointType_, PointType_, DifferenceType_> differenceFunction) Creates a constraint collector that returnsConsecutiveIntervalInfoabout the first fact. For instance,[Shift from=2, to=4] [Shift from=3, to=5] [Shift from=6, to=7] [Shift from=7, to=8]returns the following information:IntervalClusters: [[Shift from=2, to=4] [Shift from=3, to=5]], [[Shift from=6, to=7] [Shift from=7, to=8]] Breaks: [[Break from=5, to=6, length=1]]- Type Parameters:
A- type of the first mapped factPointType_- type of the fact endpointsDifferenceType_- type of difference between points- Parameters:
startMap- Maps the fact to its startendMap- Maps the fact to its enddifferenceFunction- Computes the difference between two points. The second argument is always larger than the first (ex:Duration.between(java.time.temporal.Temporal, java.time.temporal.Temporal)or(a,b) -> b - a).- Returns:
- never null
-
consecutiveTemporalIntervals
public static <A,PointType_ extends Temporal & Comparable<PointType_>> ai.timefold.solver.core.api.score.stream.uni.UniConstraintCollector<A,IntervalTree<A, consecutiveTemporalIntervalsPointType_, Duration>, ConsecutiveIntervalInfo<A, PointType_, Duration>> (Function<A, PointType_> startMap, Function<A, PointType_> endMap) Specialized version ofconsecutiveIntervals(Function,Function,BiFunction)forTemporaltypes.- Type Parameters:
A- type of the first mapped factPointType_- temporal type of the endpoints- Parameters:
startMap- Maps the fact to its startendMap- Maps the fact to its end- Returns:
- never null
-
consecutiveIntervals
public static <A> ai.timefold.solver.core.api.score.stream.uni.UniConstraintCollector<A,IntervalTree<A, consecutiveIntervalsLong, Long>, ConsecutiveIntervalInfo<A, Long, Long>> (ToLongFunction<A> startMap, ToLongFunction<A> endMap) Specialized version ofconsecutiveIntervals(Function,Function,BiFunction)for Long.- Type Parameters:
A- type of the first mapped fact- Parameters:
startMap- Maps the fact to its startendMap- Maps the fact to its end- Returns:
- never null
-
consecutiveIntervals
public static <A,B, ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector<A,IntervalType_, PointType_ extends Comparable<PointType_>, DifferenceType_ extends Comparable<DifferenceType_>> B, consecutiveIntervalsIntervalTree<IntervalType_, PointType_, DifferenceType_>, ConsecutiveIntervalInfo<IntervalType_, PointType_, DifferenceType_>> (BiFunction<A, B, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap, BiFunction<PointType_, PointType_, DifferenceType_> differenceFunction) As defined byconsecutiveIntervals(Function,Function,BiFunction).- Type Parameters:
A- type of the first mapped factB- type of the second mapped factIntervalType_- type of the item in the clusterPointType_- type of the item endpointsDifferenceType_- type of difference between points- Parameters:
intervalMap- Maps both facts to an item in the clusterstartMap- Maps the item to its startendMap- Maps the item to its enddifferenceFunction- Computes the difference between two points. The second argument is always larger than the first (ex:Duration.between(java.time.temporal.Temporal, java.time.temporal.Temporal)or(a,b) -> b - a).- Returns:
- never null
-
consecutiveTemporalIntervals
public static <A,B, ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector<A,IntervalType_, PointType_ extends Temporal & Comparable<PointType_>> B, consecutiveTemporalIntervalsIntervalTree<IntervalType_, PointType_, Duration>, ConsecutiveIntervalInfo<IntervalType_, PointType_, Duration>> (BiFunction<A, B, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap) As defined byconsecutiveTemporalIntervals(Function,Function).- Type Parameters:
A- type of the first mapped factB- type of the second mapped factIntervalType_- type of the item in the clusterPointType_- temporal type of the endpoints- Parameters:
intervalMap- Maps the three facts to an item in the clusterstartMap- Maps the fact to its startendMap- Maps the fact to its end- Returns:
- never null
-
consecutiveIntervals
public static <A,B, ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector<A,IntervalType_> B, consecutiveIntervalsIntervalTree<IntervalType_, Long, Long>, ConsecutiveIntervalInfo<IntervalType_, Long, Long>> (BiFunction<A, B, IntervalType_> intervalMap, ToLongFunction<IntervalType_> startMap, ToLongFunction<IntervalType_> endMap) As defined byconsecutiveIntervals(ToLongFunction, ToLongFunction).- Type Parameters:
A- type of the first mapped factB- type of the second mapped factIntervalType_- type of the item in the cluster- Parameters:
startMap- Maps the fact to its startendMap- Maps the fact to its end- Returns:
- never null
-
consecutiveIntervals
public static <A,B, ai.timefold.solver.core.api.score.stream.tri.TriConstraintCollector<A,C, IntervalType_, PointType_ extends Comparable<PointType_>, DifferenceType_ extends Comparable<DifferenceType_>> B, consecutiveIntervalsC, IntervalTree<IntervalType_, PointType_, DifferenceType_>, ConsecutiveIntervalInfo<IntervalType_, PointType_, DifferenceType_>> (ai.timefold.solver.core.api.function.TriFunction<A, B, C, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap, BiFunction<PointType_, PointType_, DifferenceType_> differenceFunction) As defined byconsecutiveIntervals(Function,Function,BiFunction).- Type Parameters:
A- type of the first mapped factB- type of the second mapped factC- type of the third mapped factIntervalType_- type of the item in the clusterPointType_- type of the item endpointsDifferenceType_- type of difference between points- Parameters:
intervalMap- Maps the three facts to an item in the clusterstartMap- Maps the item to its startendMap- Maps the item to its enddifferenceFunction- Computes the difference between two points. The second argument is always larger than the first (ex:Duration.between(java.time.temporal.Temporal, java.time.temporal.Temporal)or(a,b) -> b - a).- Returns:
- never null
-
consecutiveTemporalIntervals
public static <A,B, ai.timefold.solver.core.api.score.stream.tri.TriConstraintCollector<A,C, IntervalType_, PointType_ extends Temporal & Comparable<PointType_>> B, consecutiveTemporalIntervalsC, IntervalTree<IntervalType_, PointType_, Duration>, ConsecutiveIntervalInfo<IntervalType_, PointType_, Duration>> (ai.timefold.solver.core.api.function.TriFunction<A, B, C, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap) As defined byconsecutiveTemporalIntervals(Function,Function).- Type Parameters:
A- type of the first mapped factB- type of the second mapped factC- type of the third mapped factIntervalType_- type of the item in the clusterPointType_- temporal type of the endpoints- Parameters:
intervalMap- Maps the three facts to an item in the clusterstartMap- Maps the fact to its startendMap- Maps the fact to its end- Returns:
- never null
-
consecutiveIntervals
public static <A,B, ai.timefold.solver.core.api.score.stream.tri.TriConstraintCollector<A,C, IntervalType_> B, consecutiveIntervalsC, IntervalTree<IntervalType_, Long, Long>, ConsecutiveIntervalInfo<IntervalType_, Long, Long>> (ai.timefold.solver.core.api.function.TriFunction<A, B, C, IntervalType_> intervalMap, ToLongFunction<IntervalType_> startMap, ToLongFunction<IntervalType_> endMap) As defined byconsecutiveIntervals(ToLongFunction, ToLongFunction).- Type Parameters:
A- type of the first mapped factB- type of the second mapped factC- type of the third mapped factIntervalType_- type of the item in the cluster- Parameters:
startMap- Maps the fact to its startendMap- Maps the fact to its end- Returns:
- never null
-
consecutiveIntervals
public static <A,B, ai.timefold.solver.core.api.score.stream.quad.QuadConstraintCollector<A,C, D, IntervalType_, PointType_ extends Comparable<PointType_>, DifferenceType_ extends Comparable<DifferenceType_>> B, consecutiveIntervalsC, D, IntervalTree<IntervalType_, PointType_, DifferenceType_>, ConsecutiveIntervalInfo<IntervalType_, PointType_, DifferenceType_>> (ai.timefold.solver.core.api.function.QuadFunction<A, B, C, D, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap, BiFunction<PointType_, PointType_, DifferenceType_> differenceFunction) As defined byconsecutiveIntervals(Function,Function,BiFunction).- Type Parameters:
A- type of the first mapped factB- type of the second mapped factC- type of the third mapped factD- type of the fourth mapped factIntervalType_- type of the item in the clusterPointType_- type of the item endpointsDifferenceType_- type of difference between points- Parameters:
intervalMap- Maps the four facts to an item in the clusterstartMap- Maps the item to its startendMap- Maps the item to its enddifferenceFunction- Computes the difference between two points. The second argument is always larger than the first (ex:Duration.between(java.time.temporal.Temporal, java.time.temporal.Temporal)or(a,b) -> b - a).- Returns:
- never null
-
consecutiveTemporalIntervals
public static <A,B, ai.timefold.solver.core.api.score.stream.quad.QuadConstraintCollector<A,C, D, IntervalType_, PointType_ extends Temporal & Comparable<PointType_>> B, consecutiveTemporalIntervalsC, D, IntervalTree<IntervalType_, PointType_, Duration>, ConsecutiveIntervalInfo<IntervalType_, PointType_, Duration>> (ai.timefold.solver.core.api.function.QuadFunction<A, B, C, D, IntervalType_> intervalMap, Function<IntervalType_, PointType_> startMap, Function<IntervalType_, PointType_> endMap) As defined byconsecutiveTemporalIntervals(Function,Function).- Type Parameters:
A- type of the first mapped factB- type of the second mapped factC- type of the third mapped factD- type of the fourth mapped factIntervalType_- type of the item in the clusterPointType_- temporal type of the endpoints- Parameters:
intervalMap- Maps the three facts to an item in the clusterstartMap- Maps the fact to its startendMap- Maps the fact to its end- Returns:
- never null
-
consecutiveIntervals
public static <A,B, ai.timefold.solver.core.api.score.stream.quad.QuadConstraintCollector<A,C, D, IntervalType_> B, consecutiveIntervalsC, D, IntervalTree<IntervalType_, Long, Long>, ConsecutiveIntervalInfo<IntervalType_, Long, Long>> (ai.timefold.solver.core.api.function.QuadFunction<A, B, C, D, IntervalType_> intervalMap, ToLongFunction<IntervalType_> startMap, ToLongFunction<IntervalType_> endMap) As defined byconsecutiveIntervals(ToLongFunction, ToLongFunction).- Type Parameters:
A- type of the first mapped factB- type of the second mapped factC- type of the third mapped factD- type of the fourth mapped factIntervalType_- type of the item in the cluster- Parameters:
startMap- Maps the fact to its startendMap- Maps the fact to its end- Returns:
- never null
-