Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <constraint_solver.h>
Public Member Functions | |
SequenceVar (Solver *s, const std::vector< IntervalVar * > &intervals, const std::vector< IntVar * > &nexts, const std::string &name) | |
--— SequenceVar --— | |
~SequenceVar () override | |
std::string | DebugString () const override |
void | DurationRange (int64_t *dmin, int64_t *dmax) const |
void | HorizonRange (int64_t *hmin, int64_t *hmax) const |
void | ActiveHorizonRange (int64_t *hmin, int64_t *hmax) const |
void | ComputeStatistics (int *ranked, int *not_ranked, int *unperformed) const |
Compute statistics on the sequence. | |
void | RankFirst (int index) |
void | RankNotFirst (int index) |
void | RankLast (int index) |
void | RankNotLast (int index) |
void | ComputePossibleFirstsAndLasts (std::vector< int > *possible_firsts, std::vector< int > *possible_lasts) |
void | RankSequence (const std::vector< int > &rank_first, const std::vector< int > &rank_last, const std::vector< int > &unperformed) |
void | FillSequence (std::vector< int > *rank_first, std::vector< int > *rank_last, std::vector< int > *unperformed) const |
IntervalVar * | Interval (int index) const |
Returns the index_th interval of the sequence. | |
IntVar * | Next (int index) const |
Returns the next of the index_th interval of the sequence. | |
int64_t | size () const |
Returns the number of interval vars in the sequence. | |
virtual void | Accept (ModelVisitor *visitor) const |
Accepts the given visitor. | |
Public Member Functions inherited from operations_research::PropagationBaseObject | |
PropagationBaseObject (Solver *const s) | |
PropagationBaseObject (const PropagationBaseObject &)=delete | |
This type is neither copyable nor movable. | |
PropagationBaseObject & | operator= (const PropagationBaseObject &)=delete |
~PropagationBaseObject () override | |
Solver * | solver () const |
void | FreezeQueue () |
void | UnfreezeQueue () |
void | EnqueueDelayedDemon (Demon *const d) |
void | EnqueueVar (Demon *const d) |
void | ExecuteAll (const SimpleRevFIFO< Demon * > &demons) |
void | EnqueueAll (const SimpleRevFIFO< Demon * > &demons) |
void | set_action_on_fail (Solver::Action a) |
void | reset_action_on_fail () |
This method clears the failure callback. | |
void | set_variable_to_clean_on_fail (IntVar *v) |
Shortcut for variable cleaner. | |
virtual std::string | name () const |
Object naming. | |
void | set_name (absl::string_view name) |
bool | HasName () const |
Returns whether the object has been named or not. | |
virtual std::string | BaseName () const |
Returns a base name for automatic naming. | |
Public Member Functions inherited from operations_research::BaseObject | |
BaseObject () | |
BaseObject (const BaseObject &)=delete | |
This type is neither copyable nor movable. | |
BaseObject & | operator= (const BaseObject &)=delete |
virtual | ~BaseObject () |
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.
Definition at line 4944 of file constraint_solver.h.
operations_research::SequenceVar::SequenceVar | ( | Solver * | s, |
const std::vector< IntervalVar * > & | intervals, | ||
const std::vector< IntVar * > & | nexts, | ||
const std::string & | name ) |
--— SequenceVar --—
Definition at line 41 of file sched_search.cc.
|
override |
Definition at line 52 of file sched_search.cc.
|
virtual |
Accepts the given visitor.
Definition at line 75 of file sched_search.cc.
void operations_research::SequenceVar::ActiveHorizonRange | ( | int64_t * | hmin, |
int64_t * | hmax ) const |
Returns the minimum start min and the maximum end max of all unranked interval vars in the sequence.
Definition at line 111 of file sched_search.cc.
void operations_research::SequenceVar::ComputePossibleFirstsAndLasts | ( | std::vector< int > * | possible_firsts, |
std::vector< int > * | possible_lasts ) |
Computes the set of indices of interval variables that can be ranked first in the set of unranked activities.
Definition at line 193 of file sched_search.cc.
void operations_research::SequenceVar::ComputeStatistics | ( | int * | ranked, |
int * | not_ranked, | ||
int * | unperformed ) const |
Compute statistics on the sequence.
Definition at line 149 of file sched_search.cc.
|
overridevirtual |
Reimplemented from operations_research::PropagationBaseObject.
Definition at line 60 of file sched_search.cc.
void operations_research::SequenceVar::DurationRange | ( | int64_t * | dmin, |
int64_t * | dmax ) const |
Returns the minimum and maximum duration of combined interval vars in the sequence.
Definition at line 79 of file sched_search.cc.
void operations_research::SequenceVar::FillSequence | ( | std::vector< int > * | rank_first, |
std::vector< int > * | rank_last, | ||
std::vector< int > * | 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 351 of file sched_search.cc.
void operations_research::SequenceVar::HorizonRange | ( | int64_t * | hmin, |
int64_t * | hmax ) const |
Returns the minimum start min and the maximum end max of all interval vars in the sequence.
Definition at line 96 of file sched_search.cc.
IntervalVar * operations_research::SequenceVar::Interval | ( | int | index | ) | const |
Returns the index_th interval of the sequence.
Definition at line 54 of file sched_search.cc.
IntVar * operations_research::SequenceVar::Next | ( | int | index | ) | const |
Returns the next of the index_th interval of the sequence.
Definition at line 58 of file sched_search.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 296 of file sched_search.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 319 of file sched_search.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 311 of file sched_search.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 334 of file sched_search.cc.
void operations_research::SequenceVar::RankSequence | ( | 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.
Mark unperformed.
Forward.
Backward.
Definition at line 271 of file sched_search.cc.
|
inline |
Returns the number of interval vars in the sequence.
Definition at line 5018 of file constraint_solver.h.