Google OR-Tools: operations_research::IntervalVar Class Reference
Interval variables are often used in scheduling. The main characteristics of an IntervalVar are the start position, duration, and end date. All these characteristics can be queried and set, and demons can be posted on their modifications. An important aspect is optionality: an IntervalVar can be performed or not. If unperformed, then it simply does not exist, and its characteristics cannot be accessed any more. An interval var is automatically marked as unperformed when it is not consistent anymore (start greater than end, duration < 0...)
Definition at line 4909 of file constraint_solver.h.
#include <constraint_solver.h>

Public Member Functions | |
| IntervalVar (Solver *const solver, const std::string &name) | |
| IntervalVar (const IntervalVar &)=delete | |
| IntervalVar & | operator= (const IntervalVar &)=delete |
| ~IntervalVar () override | |
| virtual int64_t | StartMin () const =0 |
| virtual int64_t | StartMax () const =0 |
| virtual void | SetStartMin (int64_t m)=0 |
| virtual void | SetStartMax (int64_t m)=0 |
| virtual void | SetStartRange (int64_t mi, int64_t ma)=0 |
| virtual int64_t | OldStartMin () const =0 |
| virtual int64_t | OldStartMax () const =0 |
| virtual void | WhenStartRange (Demon *d)=0 |
| void | WhenStartRange (Solver::Closure closure) |
| void | WhenStartRange (Solver::Action action) |
| virtual void | WhenStartBound (Demon *d)=0 |
| void | WhenStartBound (Solver::Closure closure) |
| void | WhenStartBound (Solver::Action action) |
| virtual int64_t | DurationMin () const =0 |
| These methods query, set, and watch the duration of the interval var. | |
| virtual int64_t | DurationMax () const =0 |
| virtual void | SetDurationMin (int64_t m)=0 |
| virtual void | SetDurationMax (int64_t m)=0 |
| virtual void | SetDurationRange (int64_t mi, int64_t ma)=0 |
| virtual int64_t | OldDurationMin () const =0 |
| virtual int64_t | OldDurationMax () const =0 |
| virtual void | WhenDurationRange (Demon *d)=0 |
| void | WhenDurationRange (Solver::Closure closure) |
| void | WhenDurationRange (Solver::Action action) |
| virtual void | WhenDurationBound (Demon *d)=0 |
| void | WhenDurationBound (Solver::Closure closure) |
| void | WhenDurationBound (Solver::Action action) |
| virtual int64_t | EndMin () const =0 |
| These methods query, set, and watch the end position of the interval var. | |
| virtual int64_t | EndMax () const =0 |
| virtual void | SetEndMin (int64_t m)=0 |
| virtual void | SetEndMax (int64_t m)=0 |
| virtual void | SetEndRange (int64_t mi, int64_t ma)=0 |
| virtual int64_t | OldEndMin () const =0 |
| virtual int64_t | OldEndMax () const =0 |
| virtual void | WhenEndRange (Demon *d)=0 |
| void | WhenEndRange (Solver::Closure closure) |
| void | WhenEndRange (Solver::Action action) |
| virtual void | WhenEndBound (Demon *d)=0 |
| void | WhenEndBound (Solver::Closure closure) |
| void | WhenEndBound (Solver::Action action) |
| virtual bool | MustBePerformed () const =0 |
| virtual bool | MayBePerformed () const =0 |
| bool | CannotBePerformed () const |
| bool | IsPerformedBound () const |
| virtual void | SetPerformed (bool val)=0 |
| virtual bool | WasPerformedBound () const =0 |
| virtual void | WhenPerformedBound (Demon *d)=0 |
| void | WhenPerformedBound (Solver::Closure closure) |
| void | WhenPerformedBound (Solver::Action action) |
| void | WhenAnything (Demon *d) |
| Attaches a demon awakened when anything about this interval changes. | |
| void | WhenAnything (Solver::Closure closure) |
| Attaches a closure awakened when anything about this interval changes. | |
| void | WhenAnything (Solver::Action action) |
| Attaches an action awakened when anything about this interval changes. | |
| virtual IntExpr * | StartExpr ()=0 |
| virtual IntExpr * | DurationExpr ()=0 |
| virtual IntExpr * | EndExpr ()=0 |
| virtual IntExpr * | PerformedExpr ()=0 |
| virtual IntExpr * | SafeStartExpr (int64_t unperformed_value)=0 |
| virtual IntExpr * | SafeDurationExpr (int64_t unperformed_value)=0 |
| virtual IntExpr * | SafeEndExpr (int64_t unperformed_value)=0 |
| virtual void | Accept (ModelVisitor *visitor) const =0 |
| Accepts the given visitor. | |
| Public Member Functions inherited from operations_research::PropagationBaseObject | |
| PropagationBaseObject (Solver *const s) | |
| PropagationBaseObject (const PropagationBaseObject &)=delete | |
| PropagationBaseObject & | operator= (const PropagationBaseObject &)=delete |
| ~PropagationBaseObject () override | |
| std::string | DebugString () const 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 | |
| BaseObject & | operator= (const BaseObject &)=delete |
| virtual | ~BaseObject ()=default |
Static Public Attributes | |
| static const int64_t | kMinValidValue = -kMaxValidValue |
| The smallest acceptable value to be returned by StartMin(). | |
| static const int64_t | kMaxValidValue |
| The largest acceptable value to be returned by EndMax(). | |
|
inline |
◆ IntervalVar() [2/2]
|
delete |
◆ ~IntervalVar()
|
inlineoverride |
◆ Accept()
|
pure virtual |
Accepts the given visitor.
◆ CannotBePerformed()
|
inline |
◆ DurationExpr()
|
pure virtual |
◆ DurationMax()
|
pure virtual |
◆ DurationMin()
|
pure virtual |
These methods query, set, and watch the duration of the interval var.
◆ EndExpr()
|
pure virtual |
◆ EndMax()
|
pure virtual |
◆ EndMin()
|
pure virtual |
These methods query, set, and watch the end position of the interval var.
◆ IsPerformedBound()
|
inline |
◆ MayBePerformed()
|
pure virtual |
◆ MustBePerformed()
|
pure virtual |
These methods query, set, and watch the performed status of the interval var.
◆ OldDurationMax()
|
pure virtual |
◆ OldDurationMin()
|
pure virtual |
◆ OldEndMax()
|
pure virtual |
◆ OldEndMin()
|
pure virtual |
◆ OldStartMax()
|
pure virtual |
◆ OldStartMin()
|
pure virtual |
◆ operator=()
|
delete |
◆ PerformedExpr()
|
pure virtual |
◆ SafeDurationExpr()
|
pure virtual |
◆ SafeEndExpr()
|
pure virtual |
◆ SafeStartExpr()
|
pure virtual |
These methods create expressions encapsulating the start, end and duration of the interval var. If the interval var is unperformed, they will return the unperformed_value.
◆ SetDurationMax()
|
pure virtual |
◆ SetDurationMin()
|
pure virtual |
◆ SetDurationRange()
|
pure virtual |
◆ SetEndMax()
|
pure virtual |
◆ SetEndMin()
|
pure virtual |
◆ SetEndRange()
|
pure virtual |
◆ SetPerformed()
|
pure virtual |
◆ SetStartMax()
|
pure virtual |
◆ SetStartMin()
|
pure virtual |
◆ SetStartRange()
|
pure virtual |
◆ StartExpr()
|
pure virtual |
These methods create expressions encapsulating the start, end and duration of the interval var. Please note that these must not be used if the interval var is unperformed.
◆ StartMax()
|
pure virtual |
◆ StartMin()
|
pure virtual |
These methods query, set, and watch the start position of the interval var.
◆ WasPerformedBound()
|
pure virtual |
◆ WhenAnything() [1/3]
| void operations_research::IntervalVar::WhenAnything | ( | Demon * | d | ) |
Attaches a demon awakened when anything about this interval changes.
Definition at line 2272 of file interval.cc.
◆ WhenAnything() [2/3]
|
inline |
Attaches an action awakened when anything about this interval changes.
Definition at line 5041 of file constraint_solver.h.
◆ WhenAnything() [3/3]
|
inline |
Attaches a closure awakened when anything about this interval changes.
Definition at line 5036 of file constraint_solver.h.
◆ WhenDurationBound() [1/3]
|
pure virtual |
◆ WhenDurationBound() [2/3]
|
inline |
◆ WhenDurationBound() [3/3]
|
inline |
◆ WhenDurationRange() [1/3]
|
pure virtual |
◆ WhenDurationRange() [2/3]
|
inline |
◆ WhenDurationRange() [3/3]
|
inline |
◆ WhenEndBound() [1/3]
|
pure virtual |
◆ WhenEndBound() [2/3]
|
inline |
◆ WhenEndBound() [3/3]
|
inline |
◆ WhenEndRange() [1/3]
|
pure virtual |
◆ WhenEndRange() [2/3]
|
inline |
◆ WhenEndRange() [3/3]
|
inline |
◆ WhenPerformedBound() [1/3]
|
pure virtual |
◆ WhenPerformedBound() [2/3]
|
inline |
◆ WhenPerformedBound() [3/3]
|
inline |
◆ WhenStartBound() [1/3]
|
pure virtual |
◆ WhenStartBound() [2/3]
|
inline |
◆ WhenStartBound() [3/3]
|
inline |
◆ WhenStartRange() [1/3]
|
pure virtual |
◆ WhenStartRange() [2/3]
|
inline |
◆ WhenStartRange() [3/3]
|
inline |
◆ kMaxValidValue
|
const int64_t operations_research::IntervalVar::kMaxValidValue |
static |
Initial value:
=
std::numeric_limits<int64_t>::max() >> 2
The largest acceptable value to be returned by EndMax().
Definition at line 4918 of file constraint_solver.h.
◆ kMinValidValue
|
const int64_t operations_research::IntervalVar::kMinValidValue = -kMaxValidValue |
static |
The documentation for this class was generated from the following files:
- ortools/constraint_solver/constraint_solver.h
- ortools/constraint_solver/interval.cc