C++ Reference: class IntervalsRepository

This documentation is automatically generated.

This class maintains a set of intervals which correspond to three integer variables (start, end and size). It automatically registers with the PrecedencesPropagator the relation between the bounds of each interval and provides many helper functions to add precedences relation between intervals.
Method
AllIntervals

Return type: std::vector<IntervalVariable>

Utility function that returns a vector will all intervals.

CreateInterval

Return type: IntervalVariable

Arguments: IntegerVariable start, IntegerVariable end, IntegerVariable size, IntegerValue fixed_size, LiteralIndex is_present

Functions to add a new interval to the repository. - If size == kNoIntegerVariable, then the size is fixed to fixed_size. - If is_present != kNoLiteralIndex, then this is an optional interval.

EndVar

Return type: IntegerVariable

Arguments: IntervalVariable i

IntervalsRepository

Return type: explicit

Arguments: Model* model

IsOptional

Return type: bool

Arguments: IntervalVariable i

Returns whether or not a interval is optional and the associated literal.

IsPresentLiteral

Return type: Literal

Arguments: IntervalVariable i

MaxSize

Return type: IntegerValue

Arguments: IntervalVariable i

Return the maximum size of the given IntervalVariable.

MinSize

Return type: IntegerValue

Arguments: IntervalVariable i

Return the minimum size of the given IntervalVariable.

NumIntervals

Return type: int

Returns the current number of intervals in the repository. The interval will always be identified by an integer in [0, num_intervals).

SizeVar

Return type: IntegerVariable

Arguments: IntervalVariable i

The 3 integer variables associated to a interval. Fixed size intervals will have a kNoIntegerVariable as size. Note: For an optional interval, the start/end variables are propagated asssuming the interval is present. Because of that, these variables can cross each other or have an empty domain. If any of this happen, then the IsPresentLiteral() of this interval will be propagated to false.

StartVar

Return type: IntegerVariable

Arguments: IntervalVariable i