| IBM ILOG Dispatcher User's Manual > The Basics > Minimizing the Number of Vehicles > Solve > Define the closeEmptyVehicles function |
Define the closeEmptyVehicles function |
INDEX
PREVIOUS
NEXT
|
Next, you define the closeEmptyVehicles function. You use an instance of IloIterator and the member function IloRoutingSolution::getRouteSize to locate any vehicles that have an empty route. Vehicles that are not used in the solution have a route size of 0 (zero). You constrain these vehicles to be closed by adding the constraint that the next-variable of their first visit is set equal to their last visit. In other words, they never leave the depot.
Step 9 - | Close empty vehicles |
Add the following code after the comment //Close empty vehicles
| © Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |