C++ Reference
C++ Reference: Routing
Detailed Description
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 4305 of file constraint_solver.h.
Public Member Functions | |
| IntervalVar (Solver *const solver, const std::string &name) | |
| ~IntervalVar () override | |
| virtual int64 | StartMin () const =0 |
| These methods query, set, and watch the start position of the interval var. More... | |
| virtual int64 | StartMax () const =0 |
| virtual void | SetStartMin (int64 m)=0 |
| virtual void | SetStartMax (int64 m)=0 |
| virtual void | SetStartRange (int64 mi, int64 ma)=0 |
| virtual int64 | OldStartMin () const =0 |
| virtual int64 | OldStartMax () const =0 |
| virtual void | WhenStartRange (Demon *const d)=0 |
| void | WhenStartRange (Solver::Closure closure) |
| void | WhenStartRange (Solver::Action action) |
| virtual void | WhenStartBound (Demon *const d)=0 |
| void | WhenStartBound (Solver::Closure closure) |
| void | WhenStartBound (Solver::Action action) |
| virtual int64 | DurationMin () const =0 |
| These methods query, set, and watch the duration of the interval var. More... | |
| virtual int64 | DurationMax () const =0 |
| virtual void | SetDurationMin (int64 m)=0 |
| virtual void | SetDurationMax (int64 m)=0 |
| virtual void | SetDurationRange (int64 mi, int64 ma)=0 |
| virtual int64 | OldDurationMin () const =0 |
| virtual int64 | OldDurationMax () const =0 |
| virtual void | WhenDurationRange (Demon *const d)=0 |
| void | WhenDurationRange (Solver::Closure closure) |
| void | WhenDurationRange (Solver::Action action) |
| virtual void | WhenDurationBound (Demon *const d)=0 |
| void | WhenDurationBound (Solver::Closure closure) |
| void | WhenDurationBound (Solver::Action action) |
| virtual int64 | EndMin () const =0 |
| These methods query, set, and watch the end position of the interval var. More... | |
| virtual int64 | EndMax () const =0 |
| virtual void | SetEndMin (int64 m)=0 |
| virtual void | SetEndMax (int64 m)=0 |
| virtual void | SetEndRange (int64 mi, int64 ma)=0 |
| virtual int64 | OldEndMin () const =0 |
| virtual int64 | OldEndMax () const =0 |
| virtual void | WhenEndRange (Demon *const d)=0 |
| void | WhenEndRange (Solver::Closure closure) |
| void | WhenEndRange (Solver::Action action) |
| virtual void | WhenEndBound (Demon *const d)=0 |
| void | WhenEndBound (Solver::Closure closure) |
| void | WhenEndBound (Solver::Action action) |
| virtual bool | MustBePerformed () const =0 |
| These methods query, set, and watch the performed status of the interval var. More... | |
| 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 *const d)=0 |
| void | WhenPerformedBound (Solver::Closure closure) |
| void | WhenPerformedBound (Solver::Action action) |
| void | WhenAnything (Demon *const d) |
| Attaches a demon awakened when anything about this interval changes. More... | |
| void | WhenAnything (Solver::Closure closure) |
| Attaches a closure awakened when anything about this interval changes. More... | |
| void | WhenAnything (Solver::Action action) |
| Attaches an action awakened when anything about this interval changes. More... | |
| virtual IntExpr * | StartExpr ()=0 |
| These methods create expressions encapsulating the start, end and duration of the interval var. More... | |
| virtual IntExpr * | DurationExpr ()=0 |
| virtual IntExpr * | EndExpr ()=0 |
| virtual IntExpr * | PerformedExpr ()=0 |
| virtual IntExpr * | SafeStartExpr (int64 unperformed_value)=0 |
| These methods create expressions encapsulating the start, end and duration of the interval var. More... | |
| virtual IntExpr * | SafeDurationExpr (int64 unperformed_value)=0 |
| virtual IntExpr * | SafeEndExpr (int64 unperformed_value)=0 |
| virtual void | Accept (ModelVisitor *const visitor) const =0 |
| Accepts the given visitor. More... | |
| std::string | DebugString () const override |
| Solver * | solver () const |
| void | FreezeQueue () |
| This method freezes the propagation queue. More... | |
| void | UnfreezeQueue () |
| This method unfreezes the propagation queue. More... | |
| void | EnqueueDelayedDemon (Demon *const d) |
| This method pushes the demon onto the propagation queue. More... | |
| 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. More... | |
| void | set_variable_to_clean_on_fail (IntVar *v) |
| Shortcut for variable cleaner. More... | |
| virtual std::string | name () const |
| Object naming. More... | |
| void | set_name (const std::string &name) |
| bool | HasName () const |
| Returns whether the object has been named or not. More... | |
| virtual std::string | BaseName () const |
| Returns a base name for automatic naming. More... | |
Static Public Attributes | |
| static const int64 | kMinValidValue |
| The smallest acceptable value to be returned by StartMin() More... | |
| static const int64 | kMaxValidValue |
| The largest acceptable value to be returned by EndMax() More... | |
Constructor & Destructor Documentation
◆ IntervalVar()
|
inline |
Definition at line 4311 of file constraint_solver.h.
◆ ~IntervalVar()
|
inlineoverride |
Definition at line 4315 of file constraint_solver.h.
Member Function Documentation
◆ Accept()
|
pure virtual |
Accepts the given visitor.
◆ BaseName()
|
virtualinherited |
Returns a base name for automatic naming.
Reimplemented in BooleanVar.
◆ CannotBePerformed()
|
inline |
Definition at line 4403 of file constraint_solver.h.
◆ DebugString()
|
inlineoverridevirtualinherited |
Reimplemented from BaseObject.
Reimplemented in Pack, Assignment, SequenceVar, Constraint, BooleanVar, and GlobalVehicleBreaksConstraint.
Definition at line 3124 of file constraint_solver.h.
◆ 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.
◆ EnqueueAll()
|
inherited |
◆ EnqueueDelayedDemon()
|
inlineinherited |
This method pushes the demon onto the propagation queue.
It will be processed directly if the queue is empty. It will be enqueued according to its priority otherwise.
Definition at line 3144 of file constraint_solver.h.
◆ EnqueueVar()
|
inlineinherited |
Definition at line 3145 of file constraint_solver.h.
◆ ExecuteAll()
|
inherited |
◆ FreezeQueue()
|
inlineinherited |
This method freezes the propagation queue.
It is useful when you need to apply multiple modifications at once.
Definition at line 3135 of file constraint_solver.h.
◆ HasName()
|
inherited |
Returns whether the object has been named or not.
◆ IsPerformedBound()
|
inline |
Definition at line 4404 of file constraint_solver.h.
◆ MayBePerformed()
|
pure virtual |
◆ MustBePerformed()
|
pure virtual |
These methods query, set, and watch the performed status of the interval var.
◆ name()
|
virtualinherited |
Object naming.
◆ OldDurationMax()
|
pure virtual |
◆ OldDurationMin()
|
pure virtual |
◆ OldEndMax()
|
pure virtual |
◆ OldEndMin()
|
pure virtual |
◆ OldStartMax()
|
pure virtual |
◆ OldStartMin()
|
pure virtual |
◆ PerformedExpr()
|
pure virtual |
◆ reset_action_on_fail()
|
inlineinherited |
This method clears the failure callback.
Definition at line 3158 of file constraint_solver.h.
◆ 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.
◆ set_action_on_fail()
|
inlineinherited |
Definition at line 3152 of file constraint_solver.h.
◆ set_name()
|
inherited |
◆ set_variable_to_clean_on_fail()
|
inlineinherited |
Shortcut for variable cleaner.
Definition at line 3161 of file constraint_solver.h.
◆ 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 |
◆ solver()
|
inlineinherited |
Definition at line 3131 of file constraint_solver.h.
◆ 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.
◆ UnfreezeQueue()
|
inlineinherited |
This method unfreezes the propagation queue.
All modifications that happened when the queue was frozen will be processed.
Definition at line 3139 of file constraint_solver.h.
◆ WasPerformedBound()
|
pure virtual |
◆ WhenAnything() [1/3]
| void WhenAnything | ( | Demon *const | d | ) |
Attaches a demon awakened when anything about this interval changes.
◆ WhenAnything() [2/3]
|
inline |
Attaches an action awakened when anything about this interval changes.
Definition at line 4427 of file constraint_solver.h.
◆ WhenAnything() [3/3]
|
inline |
Attaches a closure awakened when anything about this interval changes.
Definition at line 4422 of file constraint_solver.h.
◆ WhenDurationBound() [1/3]
|
pure virtual |
◆ WhenDurationBound() [2/3]
|
inline |
Definition at line 4367 of file constraint_solver.h.
◆ WhenDurationBound() [3/3]
|
inline |
Definition at line 4363 of file constraint_solver.h.
◆ WhenDurationRange() [1/3]
|
pure virtual |
◆ WhenDurationRange() [2/3]
|
inline |
Definition at line 4358 of file constraint_solver.h.
◆ WhenDurationRange() [3/3]
|
inline |
Definition at line 4354 of file constraint_solver.h.
◆ WhenEndBound() [1/3]
|
pure virtual |
◆ WhenEndBound() [2/3]
|
inline |
Definition at line 4394 of file constraint_solver.h.
◆ WhenEndBound() [3/3]
|
inline |
Definition at line 4390 of file constraint_solver.h.
◆ WhenEndRange() [1/3]
|
pure virtual |
◆ WhenEndRange() [2/3]
|
inline |
Definition at line 4385 of file constraint_solver.h.
◆ WhenEndRange() [3/3]
|
inline |
Definition at line 4381 of file constraint_solver.h.
◆ WhenPerformedBound() [1/3]
|
pure virtual |
◆ WhenPerformedBound() [2/3]
|
inline |
Definition at line 4414 of file constraint_solver.h.
◆ WhenPerformedBound() [3/3]
|
inline |
Definition at line 4410 of file constraint_solver.h.
◆ WhenStartBound() [1/3]
|
pure virtual |
◆ WhenStartBound() [2/3]
|
inline |
Definition at line 4340 of file constraint_solver.h.
◆ WhenStartBound() [3/3]
|
inline |
Definition at line 4336 of file constraint_solver.h.
◆ WhenStartRange() [1/3]
|
pure virtual |
◆ WhenStartRange() [2/3]
|
inline |
Definition at line 4331 of file constraint_solver.h.
◆ WhenStartRange() [3/3]
|
inline |
Definition at line 4327 of file constraint_solver.h.
Member Data Documentation
◆ kMaxValidValue
|
static |
The largest acceptable value to be returned by EndMax()
Definition at line 4310 of file constraint_solver.h.
◆ kMinValidValue
|
static |
The smallest acceptable value to be returned by StartMin()
Definition at line 4308 of file constraint_solver.h.
The documentation for this class was generated from the following file: