Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set | ||
|
||
// doxy/ or-tools/ src/ constraint_solver/ |
#include <constraint_solver.h>
Public Member Functions | |
SequenceVar (Solver *const s, const IntervalVar *const *intervals, int size, const string &name) | |
SequenceVar. | |
virtual | ~SequenceVar () |
virtual string | DebugString () const |
void | DurationRange (int64 *const dmin, int64 *const dmax) const |
Returns the minimum and maximum duration of combined interval vars in the sequence. | |
void | HorizonRange (int64 *const hmin, int64 *const hmax) const |
Returns the minimum start min and the maximum end max of all interval vars in the sequence. | |
void | ActiveHorizonRange (int64 *const hmin, int64 *const hmax) const |
Returns the minimum start min and the maximum end max of all unranked interval vars in the sequence. | |
int | Ranked () const |
Returns the number of interval vars already ranked. | |
int | NotRanked () const |
Returns the number of not-unperformed interval vars that may be performed and that are not yet ranked. | |
void | RankFirst (int index) |
Ranks the index_th interval var first of all unranked interval vars. | |
void | RankNotFirst (int index) |
Indicates that the index_th interval var will not be ranked first of all currently unranked interval vars. | |
void | RankLast (int index) |
Ranks the index_th interval var first of all unranked interval vars. | |
void | RankNotLast (int index) |
Indicates that the index_th interval var will not be ranked first of all currently unranked interval vars. | |
void | AddPrecedence (int before, int after) |
Adds a precedence relation (STARTS_AFTER_END) between two activities of the sequence var. | |
void | ComputePossibleFirstsAndLasts (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. | |
void | RankSequence (const std::vector< int > &rank_firsts, const std::vector< int > &rank_lasts, const std::vector< int > &unperformed) |
Applies the following sequence of ranks, ranks first, then rank last. | |
void | FillSequence (std::vector< int > *const rank_first, std::vector< int > *const rank_lasts, std::vector< int > *const unperformed) const |
Clears 'rank_first' and 'rank_last', and fills them with the intervals in the order of the ranks. | |
IntervalVar * | Interval (int index) const |
Returns the index_th interval of the sequence. | |
int | size () const |
Returns the number of interval vars in the sequence. | |
virtual void | Accept (ModelVisitor *const visitor) const |
Accepts the given visitor. |
A sequence variable is a variable which domain is a set of possible orderings of the interval variables. It allows ordering tasks. It has two sets of methods: ComputePossibleFirstsAndLasts() which returns the list of interval variables thant can be ranked first or lasts, and RankFirst/RankNotFirst/RankLast/RankNotLast which can be used to create the search decision.
Definition at line 4175 of file constraint_solver.h.
operations_research::SequenceVar::SequenceVar | ( | Solver *const | s, | |
const IntervalVar *const * | intervals, | |||
int | size, | |||
const string & | name | |||
) |
operations_research::SequenceVar::~SequenceVar | ( | ) | [virtual] |
Definition at line 1766 of file resource.cc.
string operations_research::SequenceVar::DebugString | ( | ) | const [virtual] |
Reimplemented from operations_research::PropagationBaseObject.
Definition at line 1772 of file resource.cc.
void operations_research::SequenceVar::DurationRange | ( | int64 *const | dmin, | |
int64 *const | dmax | |||
) | const |
Returns the minimum and maximum duration of combined interval vars in the sequence.
Definition at line 1794 of file resource.cc.
void operations_research::SequenceVar::HorizonRange | ( | int64 *const | hmin, | |
int64 *const | hmax | |||
) | const |
Returns the minimum start min and the maximum end max of all interval vars in the sequence.
Definition at line 1810 of file resource.cc.
void operations_research::SequenceVar::ActiveHorizonRange | ( | int64 *const | hmin, | |
int64 *const | hmax | |||
) | const |
Returns the minimum start min and the maximum end max of all unranked interval vars in the sequence.
Definition at line 1836 of file resource.cc.
int operations_research::SequenceVar::Ranked | ( | ) | const |
int operations_research::SequenceVar::NotRanked | ( | ) | const |
Returns the number of not-unperformed interval vars that may be performed and that are not yet ranked.
Definition at line 1861 of file resource.cc.
void operations_research::SequenceVar::RankFirst | ( | int | index | ) |
Ranks the index_th interval var first of all unranked interval vars.
After that, it will no longer be considered ranked.
Definition at line 2032 of file resource.cc.
void operations_research::SequenceVar::RankNotFirst | ( | int | index | ) |
Indicates that the index_th interval var will not be ranked first of all currently unranked interval vars.
Definition at line 2051 of file resource.cc.
void operations_research::SequenceVar::RankLast | ( | int | index | ) |
Ranks the index_th interval var first of all unranked interval vars.
After that, it will no longer be considered ranked.
Definition at line 2072 of file resource.cc.
void operations_research::SequenceVar::RankNotLast | ( | int | index | ) |
Indicates that the index_th interval var will not be ranked first of all currently unranked interval vars.
Definition at line 2091 of file resource.cc.
void operations_research::SequenceVar::AddPrecedence | ( | int | before, | |
int | after | |||
) |
Adds a precedence relation (STARTS_AFTER_END) between two activities of the sequence var.
Definition at line 1910 of file resource.cc.
void operations_research::SequenceVar::ComputePossibleFirstsAndLasts | ( | 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.
Definition at line 1871 of file resource.cc.
void operations_research::SequenceVar::RankSequence | ( | const std::vector< int > & | rank_firsts, | |
const std::vector< int > & | rank_lasts, | |||
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.
Definition at line 2009 of file resource.cc.
void operations_research::SequenceVar::FillSequence | ( | std::vector< int > *const | rank_first, | |
std::vector< int > *const | rank_lasts, | |||
std::vector< int > *const | unperformed | |||
) | const |
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.
Definition at line 2112 of file resource.cc.
IntervalVar * operations_research::SequenceVar::Interval | ( | int | index | ) | const |
int operations_research::SequenceVar::size | ( | ) | const [inline] |
Returns the number of interval vars in the sequence.
Definition at line 4254 of file constraint_solver.h.
void operations_research::SequenceVar::Accept | ( | ModelVisitor *const | visitor | ) | const [virtual] |