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_>
AConsecutiveSetTreedetermines 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
Constructors Constructor Description ConsecutiveSetTree(BiFunction<Point_,Point_,Difference_> differenceFunction, BiFunction<Difference_,Difference_,Difference_> sumFunction, Difference_ maxDifference, Difference_ zeroDifference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Value_ item, Point_ point)Iterable<Break<Value_,Difference_>>getBreaks()Iterable<Sequence<Value_,Difference_>>getConsecutiveSequences()booleanremove(Value_ item)StringtoString()
-
-
-
Constructor Detail
-
ConsecutiveSetTree
public ConsecutiveSetTree(BiFunction<Point_,Point_,Difference_> differenceFunction, BiFunction<Difference_,Difference_,Difference_> sumFunction, Difference_ maxDifference, Difference_ zeroDifference)
-
-
Method Detail
-
getConsecutiveSequences
public Iterable<Sequence<Value_,Difference_>> 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
public Iterable<Break<Value_,Difference_>> 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
-
remove
public boolean remove(Value_ item)
-
-