![]() |
Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
|
The following constraint ensures that incompatibilities and requirements between types are respected. It verifies both "hard" and "temporal" incompatibilities. Two nodes with hard incompatible types cannot be served by the same vehicle at all, while with a temporal incompatibility they can't be on the same route at the same time. The VisitTypePolicy of a node determines how visiting it impacts the type count on the route. For example, for
#include <routing.h>
Public Member Functions | |
| TypeRegulationsConstraint (const RoutingModel &model) | |
| void | Post () override |
| void | InitialPropagate () override |
| Public Member Functions inherited from operations_research::Constraint | |
| Constraint (Solver *const solver) | |
| Constraint (const Constraint &)=delete | |
| Constraint & | operator= (const Constraint &)=delete |
| ~Constraint () override | |
| std::string | DebugString () const override |
| void | PostAndPropagate () |
| virtual void | Accept (ModelVisitor *visitor) const |
| Accepts the given visitor. | |
| bool | IsCastConstraint () const |
| Is the constraint created by a cast from expression to integer variable? | |
| virtual IntVar * | Var () |
| 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 |
|
explicit |
Definition at line 7095 of file routing.cc.
|
overridevirtual |
This method performs the initial propagation of the constraint. It is called just after the post.
Implements operations_research::Constraint.
Definition at line 7143 of file routing.cc.
|
overridevirtual |
This method is called when the constraint is processed by the solver. Its main usage is to attach demons to variables.
Implements operations_research::Constraint.
Definition at line 7128 of file routing.cc.