Duration and parking
Duration¶
The duration of a Job is the amount of time which a Driver will spend
serving that Job once they are on site. It is often referred to as the
service time.
During the optimisation the duration is used to calculate the
Estimated Time of Departure (ETD) from a Job, together with any
applied parking:
job.etd = job.eta + parking + duration
Parking Duration¶
parking_duration is the time a Driver spends parking or docking after
they arrive at a Job, before they finish serving it. It is part of the
on-site stop, not extra driving.
Use it when arriving at a site takes time of its own — finding a park, booking into a dock, passing a gate — that you do not want to charge again if the Driver is already there.
Typical uses:
- A warehouse dock: time to get onto the dock, then several pickups or drops in a row
- A customer site with a long walk from the street
- A gated facility with a check-in
The sequence at a stop is always:
- Arrive (this is the Job's ETA)
- Park, if parking applies at this stop
- Serve (
duration) - Leave (this is the Job's ETD)
How a stop is timed
Parking and service are one contiguous block and cannot be split.
Set parking_duration on every Job that needs it. The optimiser applies
it only when the Driver actually drives to that location (nonzero driving
time from the previous stop, including from the Driver's start). Service
duration is still applied on every Job.
If the first Job is at the Driver's start location (zero driving time from start), parking is not applied. Parking is applied again if the Driver leaves the site and later returns.
parking_duration is optional and defaults to 0. Units are minutes,
the same as duration.
earliest_eta = previous_etd + driving_time
job.eta = max(earliest_eta, arrive_after)
job.etd = job.eta + parking_if_first_at_site + duration
This is independent of Pickup Delivery. A single warehouse drop, a site visit, or any other stop can have a parking time. When several warehouse pickups or drops sit next to each other, see Pickup Delivery with Parking Duration.
Example
The Driver starts at the warehouse. The first Job is a pickup at that same warehouse, so parking is waived. The next Job is a delivery elsewhere, so parking is applied there.
{
"drivers": [
{
"uid": "driver_1",
"shift_start": 8,
"shift_end": 17,
"start": {"lat": -33.867798, "lon": 151.166256},
"end": "start"
}
],
"jobs": [
{
"uid": "warehouse_pickup",
"duration": 8, // (1)
"parking_duration": 10, // (2)
"location": {"lat": -33.867798, "lon": 151.166256}
},
{
"uid": "customer_drop",
"duration": 5,
"parking_duration": 3, // (3)
"location": {"lat": -33.880661, "lon": 151.183096},
"pickup_from": "warehouse_pickup" // (4)
}
],
"settings": {}
}
- Loading time — applied on every Job
- Dock time — waived here because the Driver starts at this warehouse
- Applied: the Driver drove to this customer
- Pickup Delivery pair; parking is independent of that coupling