The output is a schedule, where each of the visits are optimally allocated across the available vehicles. Estimated arrival and finishing times are given for each location. Note that the arrival time at the first location basically means the departure time from the depot.
An example response can be found in the side bar.
{
"status": "success",
"total_travel_time": 31.983334,
"total_idle_time": 0,
"num_unserved": 0,
"unserved": null,
"solution": {
"vehicle_1": [
{
"location_id": "depot",
"location_name": "800 Kingsway",
"arrival_time": "08:00"
},
{
"location_id": "order_3",
"location_name": "800 Robson",
"arrival_time": "08:10",
"finish_time": "08:20"
},
{
"location_id": "order_2",
"location_name": "3780 Arbutus",
"arrival_time": "08:29",
"finish_time": "09:10"
},
{
"location_id": "order_1",
"location_name": "6800 Cambie",
"arrival_time": "09:19",
"finish_time": "09:29"
},
{
"location_id": "depot",
"location_name": "800 Kingsway",
"arrival_time": "09:39"
}
]
}
}
When there are too many visits — or the time windows are too tight — and the fleet cannot possibly visit all locations, some visits will be unserved
. In other cases, a location could have been incorrectly geocoded and out of your region. Geocoding mistakes are common, since an address can be quite ambiguous at times. We will intelligently deduce your intended region based on your inputs, and return outliers as unserved.
We will return both those location IDs in unserved
as follows in the API response:
{
"num_unserved": 2,
"unserved": {
"order_1": "lat/lng coordinate is out of your region",
"order_2": "cannot be visited within the constraints"
}
}
PROPERTY | TYPE | NOTES |
---|---|---|
status | String | A sanity check, will always be "success" when the HTTP code is 200. |
total_travel_time | Number (minutes) | Total travel time of the entire fleet in minutes. |
total_idle_time | Number (minutes) | Total number of minutes that the entire fleet in waiting idle. |
num_unserved | Number | Number of visits that could not be scheduled. |
unserved | Object | Visits that could not be scheduled, with their reasons. |
solution | Object | The optimized schedule, where the keys reference the vehicle IDs and the values are ordered arrays of visits (and estimated arrival and finish times). |