IBM ILOG Dispatcher User's Manual > Transportation Industry Solutions > Pickup and Delivery by Multiple Vehicles from Multiple Depots > Model > Define the Depot::createVehicles function

You create a function that will be called by RoutingModel::createDepots. This loop will be used to create the vehicles attached to each depot. This code is provided for you:

void Depot::createVehicles(IloDimension2 time,
                           IloDimension2 length,
                           IloDimension1 weight) {
  for (IloInt v=0; v < _nbOfTrucks; ++v) {
    IloVehicle vehicle = createOneVehicle(v, time, length, weight);
    _vehicles[v] = vehicle;
  }
}