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 add_linear_relation is true, then we also link start, size and end. - If size == kNoIntegerVariable, then the size is fixed to fixed_size. - If is_present != kNoLiteralIndex, then this is an optional interval.

CreateInterval

Return type: IntervalVariable

Arguments: AffineExpression start, AffineExpression end, AffineExpression size, LiteralIndex is_present, bool add_linear_relation

End

Return type: AffineExpression

Arguments: IntervalVariable i

EndVar

Return type: IntegerVariable

Arguments: IntervalVariable i

IntervalsRepository

Return type: explicit

Arguments: Model* model

IsAbsent

Return type: bool

Arguments: IntervalVariable i

IsOptional

Return type: bool

Arguments: IntervalVariable i

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

IsPresent

Return type: bool

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).

PresenceLiteral

Return type: Literal

Arguments: IntervalVariable i

Size

Return type: AffineExpression

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 PresenceLiteral() of this interval will be propagated to false.

SizeVar

Return type: IntegerVariable

Arguments: IntervalVariable i

Deprecated.

Start

Return type: AffineExpression

Arguments: IntervalVariable i

StartVar

Return type: IntegerVariable

Arguments: IntervalVariable i