Class ConsecutiveSetTree<Value_,Point_ extends Comparable<Point_>,Difference_ extends Comparable<Difference_>>
java.lang.Object
ai.timefold.solver.examples.common.experimental.impl.ConsecutiveSetTree<Value_,Point_,Difference_>
- Type Parameters:
Value_- The type of value stored (examples: shifts)Point_- The type of the point (examples: int, LocalDateTime)Difference_- The type of the difference (examples: int, Duration)
- All Implemented Interfaces:
ConsecutiveInfo<Value_,Difference_>
public final class ConsecutiveSetTree<Value_,Point_ extends Comparable<Point_>,Difference_ extends Comparable<Difference_>>
extends Object
implements ConsecutiveInfo<Value_,Difference_>
A
ConsecutiveSetTree determines what values are consecutive. A sequence
x1, x2, x3, ..., xn
is understood to be consecutive by d iff
x2 − x1 ≤ d, x3 − x2 ≤ d, ..., xn −
xn-1 ≤ d.
This data structure can be thought as an interval tree that maps the point p to
the interval [p, p + d].-
Constructor Summary
ConstructorsConstructorDescriptionConsecutiveSetTree(BiFunction<Point_, Point_, Difference_> differenceFunction, BiFunction<Difference_, Difference_, Difference_> sumFunction, Difference_ maxDifference, Difference_ zeroDifference) -
Method Summary
-
Constructor Details
-
ConsecutiveSetTree
public ConsecutiveSetTree(BiFunction<Point_, Point_, Difference_> differenceFunction, BiFunction<Difference_, Difference_, Difference_> sumFunction, Difference_ maxDifference, Difference_ zeroDifference)
-
-
Method Details
-
getConsecutiveSequences
- Specified by:
getConsecutiveSequencesin interfaceConsecutiveInfo<Value_,Point_ extends Comparable<Point_>> - Returns:
- never null, an iterable that iterates through the sequences contained in the collection in ascending order
-
getBreaks
- Specified by:
getBreaksin interfaceConsecutiveInfo<Value_,Point_ extends Comparable<Point_>> - Returns:
- never null, an iterable that iterates through the breaks contained in the collection in ascending order
-
add
-
remove
-
toString
-