![]() |
OR-Tools
9.6
|
GlobalVehicleBreaksConstraint ensures breaks constraints are enforced on all vehicles in the dimension passed to its constructor.
It is intended to be used for dimensions representing time. A break constraint ensures break intervals fit on the route of a vehicle. For a given vehicle, it forces break intervals to be disjoint from visit intervals, where visit intervals start at CumulVar(node) and last for node_visit_transit[node]. Moreover, it ensures that there is enough time between two consecutive nodes of a route to do transit and vehicle breaks, i.e. if Next(nodeA) = nodeB, CumulVar(nodeA) = tA and CumulVar(nodeB) = tB, then SlackVar(nodeA) >= sum_{breaks \subseteq [tA, tB)} duration(break).
Public Member Functions | |
| GlobalVehicleBreaksConstraint (const RoutingDimension *dimension) | |
| std::string | DebugString () const override |
| void | Post () override |
| This method is called when the constraint is processed by the solver. More... | |
| void | InitialPropagate () override |
| This method performs the initial propagation of the constraint. More... | |
| void | PostAndPropagate () |
| Calls Post and then Propagate to initialize the constraints. More... | |
| virtual void | Accept (ModelVisitor *const visitor) const |
| Accepts the given visitor. More... | |
| bool | IsCastConstraint () const |
| Is the constraint created by a cast from expression to integer variable? More... | |
| virtual IntVar * | Var () |
| Creates a Boolean variable representing the status of the constraint (false = constraint is violated, true = constraint is satisfied). More... | |
| 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... | |
|
explicit |
Definition at line 707 of file routing_breaks.cc.
|
virtualinherited |
Accepts the given visitor.
Reimplemented in IfThenElseCt, LightIntIntFunctionElementCt< F >, LightIntFunctionElementCt< F >, and Pack.
Definition at line 3333 of file constraint_solver.cc.
|
virtualinherited |
Returns a base name for automatic naming.
Reimplemented in BooleanVar.
Definition at line 2549 of file constraint_solver.cc.
|
inlineoverridevirtual |
Reimplemented from Constraint.
|
inherited |
Definition at line 2555 of file constraint_solver.cc.
|
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 3287 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3288 of file constraint_solver.h.
|
inherited |
Definition at line 2551 of file constraint_solver.cc.
|
inlineinherited |
This method freezes the propagation queue.
It is useful when you need to apply multiple modifications at once.
Definition at line 3278 of file constraint_solver.h.
|
inherited |
Returns whether the object has been named or not.
Definition at line 2547 of file constraint_solver.cc.
|
overridevirtual |
This method performs the initial propagation of the constraint.
It is called just after the post.
Implements Constraint.
Definition at line 744 of file routing_breaks.cc.
|
inherited |
Is the constraint created by a cast from expression to integer variable?
Definition at line 3339 of file constraint_solver.cc.
|
virtualinherited |
Object naming.
Reimplemented in PiecewiseLinearExpr.
Definition at line 2539 of file constraint_solver.cc.
|
overridevirtual |
This method is called when the constraint is processed by the solver.
Its main usage is to attach demons to variables.
Implements Constraint.
Definition at line 715 of file routing_breaks.cc.
|
inherited |
Calls Post and then Propagate to initialize the constraints.
This is usually done in the root node.
Definition at line 3325 of file constraint_solver.cc.
|
inlineinherited |
This method clears the failure callback.
Definition at line 3301 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3295 of file constraint_solver.h.
|
inherited |
Definition at line 2543 of file constraint_solver.cc.
|
inlineinherited |
Shortcut for variable cleaner.
Definition at line 3304 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3274 of file constraint_solver.h.
|
inlineinherited |
This method unfreezes the propagation queue.
All modifications that happened when the queue was frozen will be processed.
Definition at line 3282 of file constraint_solver.h.
|
virtualinherited |
Creates a Boolean variable representing the status of the constraint (false = constraint is violated, true = constraint is satisfied).
It returns nullptr if the constraint does not support this API.
Definition at line 3343 of file constraint_solver.cc.