Search for content

Service Times

All vehicles have a service time for the pickup and delivery task. Each task is different: Large or heavy items may require a longer time to load and unload. Transports that require extensive load securing will also take longer to execute. Also, the conditions at a location or the design of a vehicle might require additional time for service. These times are taken into account when considering the time profile of a route.

Pickup or delivery service times can be specified within a transport. Additional service times can be specified at locations and at the vehicles. Service time integers are interpreted as seconds needed to perform the service type, whereas service time doubles are interpreted as scaling factors for existing service times. The overall service time at a stop is computed as the sum of the service action service time and the once-per-stop service time, which are both explained in more detail further down the page.

Why are service times relevant to the optimisation?

Service times are necessary to be modelled if the duration spent at locations is non-negligible. If, for example, a driver will have to spend an hour unloading goods at a location and this time is not supplied for route planning, the driver might actually have to violate the working time directives in order to execute the optimised route.

Overview of service time attributes

  • deliveryServiceTime of a transport - service time for delivery at a stop. Each delivery is different: Large or heavy items may require a longer time to unload.
  • pickupServiceTime of a transport - service time for a pickup at a stop. Each pickup is different: Large or heavy items may require a longer time to load.
  • serviceTimeFactor of a vehicle - a factor that scales transport-dependent service times. A vehicle may have (or lack) equipment that allows for faster loading or unloading.
  • applyVehicleDependentServiceTimeFactor of a location - a boolean that allows to ignore service time factors. If a forklift is available at a location, vehicles already equipped with a forklift cannot perform loading or unloading faster than others. Setting this attribute  false ensures that this is considered correctly
  • serviceTimePerPickupStop of a location - service time for a depot stop at which at least one pickup is performed. A driver might have to check the load on the vehicle and the vehicle itself before moving on the road.
  • serviceTimePerDeliveryStop of a location - service time for depot stop at which at least one delivery is performed. A driver might have to check the vehicle or document the delivered goods after delivering goods.
  • serviceTimePerTransportStop of a location - service time for a customer stop. A driver might have to register before entering a location or fill out some forms while he attends the location.

Once-per-stop service time

The once-per-stop service time is computed differently for stops at locations of different types. 

For a stop at a depot location that groups pickups the once-per-stop service time is computed as the sum of servicetimePerPickupStop of the location and the serviceTimePerTransportStop of the corresponding vehicle. Similarly for a stop at a depot location that groups deliveries the once-per-stop service time is computed as the sum of servicetimePerDeliveryStop of the location and the serviceTimePerTransportStop of the corresponding vehicle.

If the stop is a customer location, in most cases the once-per-stop service time is computed as the sum of serviceTimePerTransportStop of the corresponding vehicle and the serviceTimePerTransportStop of the customer location. The only case in which the computation differs is if the previous stop of the route is at a location that has the same customerId. In this case, the once-per-stop service time is set to zero for this stop. Thus in a sequence of stops at locations with the same customerId the once-per-stop service time is only considered once.

Service action service times

The base value for the service times for service actions at a stop is the sum of pickupServiceTime for all pickups and the deliveryServiceTime of all deliveries. If the location of the stop has applyVehicleDependentServiceTimeFactor set to true, this base value is multiplied  serviceTimeFactor by the corresponding vehicle to get the service time for service action. Otherwise, the base value itself is the service time for service actions.

Example

In this example, we regard three locations. At the Depot and at Customer2 there is a forklift available, which is why the vehicle dependent service time factor at the two locations should be ignored. At Customer1 each driver entering needs to be registered at the front desk, which takes about two minutes. At the Depot each time before goods are loaded onto the vehicle, the vehicle has to be thoroughly cleaned taking up one hour. These locations can be defined as follows.

"locations": [
  {
    "id": "Depot",
    "type": "DEPOT",
    "latitude": 49.60804,
    "longitude": 6.113033,
    "applyVehicleDependentServiceTimeFactor": false,
    "depotLocationAttributes": {
      "serviceTimePerPickupStop": 3600
    }
  },
  {
    "id": "Customer1",
    "type": "CUSTOMER",
    "latitude": 49.609597,
    "longitude": 6.097412,
    "customerLocationAttributes": {
      "serviceTimePerTransportStop": 60
    }
  },
  {
    "id": "Customer2",
    "type": "CUSTOMER",
    "latitude": 49.619597,
    "longitude": 6.197412,
    "applyVehicleDependentServiceTimeFactor": false
  }
]

There are three vehicles to be planned. Each vehicle comes with a pickupServiceTime and a deliveryServiceTime.

"transports": [
  {
    "id": "Transport-Depot-Customer1",
    "pickupLocationId": "Depot",
    "pickupServiceTime": 60,
    "deliveryLocationId": "Customer1",
    "deliveryServiceTime": 60
  },
  {
    "id": "Transport-Depot-Customer2",
    "pickupLocationId": "Depot",
    "pickupServiceTime": 180,
    "deliveryLocationId": "Customer2",
    "deliveryServiceTime": 180
  },
  {
    "id": "Transport-Customer2-Depot",
    "pickupLocationId": "Customer2",
    "pickupServiceTime": 120,
    "deliveryLocationId": "Depot",
    "deliveryServiceTime": 120
  }
]

Finally, there are two vehicles available. vehicle1 has a forklift available but is old, so after each stop, the driver needs to perform some maintenance tasks on the vehicle which take ten minutes. vehicle2 has no forklift available but is rather new, so there is no maintenance task necessary during working hours. We model the difference between the two vehicles by setting the serviceTimeFactor of vehicle2 to two. For each service action performed on a route using vehicle2 the service time will be twice as high.

"vehicles": [
    {
      "id": "vehicle1",
      "serviceTimePerTransportStop": 300
    },
    {
      "id": "vehicle2",
      "serviceTimeFactor": 2.0
    }
]

We now determine the service time of the following intuitive route for both of the possible vehicles.

"routes": [
  [
    "vehicleId": "vehiclex",
    "stops": [
      {
        "locationId": "Depot",
        "deliveryIds": [],
        "pickupIds": ["Transport-Depot-Customer1", "Transport-Depot-Customer2"]
      },
      {
        "locationId": "Customer1",
        "deliveryIds": ["Transport-Depot-Customer1"],
        "pickupIds": []
      },
      {
        "locationId": "Customer2",
        "deliveryIds": ["Transport-Depot-Customer2"],
        "pickupIds": ["Transport-Customer2-Depot"]
      },
      {
         "locationId": "Depot",
         "deliveryIds": ["Transport-Customer2-Depot"],
         "pickupIds": []
      }
    ]
  ]
]

For vehicle1 the service time of the four stops are 

  1. Four minutes of service time for service actions plus one hour and five minutes once-per-stop service time
  2. One minute of service time for service actions plus six minutes of once-per-stop service time
  3. Five minutes of service time for service actions plus five minutes once-per-stop service time
  4. Two minutes of service time for service actions plus five minutes of once-per-stop service time

As vehicle2 has no serviceTimePerTransportStop and the serviceTimeFactor will only be regarded at Customer1 the service times for the four stops are in this case

  1. Four minutes of service time for service actions plus one hour of once-per-stop service time
  2. Two minutes of service time for service actions plus one minute of once-per-stop service time
  3. Five minutes of service time for service actions
  4. Two minutes of service time for service actions

Overall the service time of the route executed by vehicle1 is therefore one hour and 33 minutes and for vehicle2 only one hour and 14 minutes.