IBM ILOG Dispatcher User's Manual > The Basics > IBM ILOG Dispatcher Concepts > Model > Modeling other side constraints |
Modeling other side constraints |
INDEX
![]() |
Dispatcher provides specific constraints that enable you to model other important side constraints, such as lunch breaks or visit disjunctions.
A vehicle break is a period of time in which a vehicle is not available to make a visit, such as during the driver's lunch period. In Dispatcher, breaks are modeled as constraints. A break is performed by a vehicle on a dimension (usually time). The break has a start time, a duration, and a position in the route, all of which can vary. A break can interrupt a customer visit or not, as desired.
To create a break where vehicle
is the vehicle performing the break, time
is the dimension, startLunch
is the start variable, and 1.0
is the duration:
IloNumVar startLunch(env, 12.0, 13.0); IloVehicleBreakCon lunch(vehicle, time, startLunch, 1.0) |
Once the break is created it is added, just like any constraint:
mdl.add(lunch); |
After a break has been created and added to the routing plan, it must be instantiated. In Dispatcher, this must be done when a move is taken. The following goal can be used for doing so:
IloInstantiateVehicleBreaks(env); |
More than one break can be specified per vehicle, and breaks can be involved in meta-constraints. For example:
mdl.add(lunch && (coffee1 || coffee2)); |
For more information, see Chapter 8, Adding Vehicle Breaks.
When vehicle breaks are allowed to interrupt customer visits, two other visit-related variables come into play. These are the duration variable and the end-cumul variable.
The duration variable represents the real time taken to process the visit. When a visit cannot be broken by vehicle breaks, this is simply equal to the value of the delay variable of the visit. However, in the case where visits can be so interrupted, the value of the duration variable of a visit is equal to the value of the delay variable plus the durations of any vehicle breaks which interrupt the visit.
At all times, the end-cumul variable is equal to the cumul variable plus the duration variable. It represents the time at which processing of the visit is complete.
There are times when only one of two visits can be performed, or when alternative sites for a delivery exist. To solve problems with these conditions, visit disjunctions can be created.
In Dispatcher, a visit can be performed (assigned to a vehicle) or unperformed. These constraints can be used to set up visit disjunctions.
There are two constraints for stating that a visit has to be performed or not:
IloConstraint IloVisit::performed() const; IloConstraint IloVisit::unperformed() const; |
If there are two visits, and only one visit can be performed, a disjunction can be created as follows:
mdl.add(visit1.performed() != visit2.performed()); |
For more information, see Chapter 5, Adding Visit Disjunctions.
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |