C++ Reference: class SequenceVar

This documentation is automatically generated.

A sequence variable is a variable whose domain is a set of possible orderings of the interval variables. It allows ordering of tasks. It has two sets of methods: ComputePossibleFirstsAndLasts(), which returns the list of interval variables that can be ranked first or last; and RankFirst/RankNotFirst/RankLast/RankNotLast, which can be used to create the search decision.
Method
Accept

Return type: virtual void

Arguments: ModelVisitor* const visitor

Accepts the given visitor.

ActiveHorizonRange

Return type: void

Arguments: int64* const hmin, int64* const hmax

Returns the minimum start min and the maximum end max of all unranked interval vars in the sequence.

ComputePossibleFirstsAndLasts

Return type: void

Arguments: std::vector<int>* const possible_firsts, std::vector<int>* const possible_lasts

Computes the set of indices of interval variables that can be ranked first in the set of unranked activities.

ComputeStatistics

Return type: void

Arguments: int* const ranked, int* const not_ranked, int* const unperformed

Compute statistics on the sequence.

DebugString

Return type: std::string

DurationRange

Return type: void

Arguments: int64* const dmin, int64* const dmax

Returns the minimum and maximum duration of combined interval vars in the sequence.

FillSequence

Return type: void

Arguments: std::vector<int>* const rank_first, std::vector<int>* const rank_last, std::vector<int>* const unperformed

Clears 'rank_first' and 'rank_last', and fills them with the intervals in the order of the ranks. If all variables are ranked, 'rank_first' will contain all variables, and 'rank_last' will contain none. 'unperformed' will contains all such interval variables. rank_first and rank_last represents different directions. rank_first[0] corresponds to the first interval of the sequence. rank_last[0] corresponds to the last interval of the sequence.

HorizonRange

Return type: void

Arguments: int64* const hmin, int64* const hmax

Returns the minimum start min and the maximum end max of all interval vars in the sequence.

Interval

Return type: IntervalVar*

Arguments: int index

Returns the index_th interval of the sequence.

Next

Return type: IntVar*

Arguments: int index

Returns the next of the index_th interval of the sequence.

RankFirst

Return type: void

Arguments: int index

Ranks the index_th interval var first of all unranked interval vars. After that, it will no longer be considered ranked.

RankLast

Return type: void

Arguments: int index

Ranks the index_th interval var first of all unranked interval vars. After that, it will no longer be considered ranked.

RankNotFirst

Return type: void

Arguments: int index

Indicates that the index_th interval var will not be ranked first of all currently unranked interval vars.

RankNotLast

Return type: void

Arguments: int index

Indicates that the index_th interval var will not be ranked first of all currently unranked interval vars.

RankSequence

Return type: void

Arguments: const std::vector<int>& rank_first, const std::vector<int>& rank_last, const std::vector<int>& unperformed

Applies the following sequence of ranks, ranks first, then rank last. rank_first and rank_last represents different directions. rank_first[0] corresponds to the first interval of the sequence. rank_last[0] corresponds to the last interval of the sequence. All intervals in the unperformed vector will be marked as such.

SequenceVar

Arguments: Solver* const s, const std::vector<IntervalVar*>& intervals, const std::vector<IntVar*>& nexts, const std::string& name

~SequenceVar

size

Return type: int64

Returns the number of interval vars in the sequence.