The scheduledRoutes
field is an array of optimized routes where each route is assigned a sequence of orders. Each of these routes also contain summary statistics like the driving time, total distance, etc.
{
"routeSchedule": {
"scheduledRoutes": [
{scheduledRoute 1},
{scheduledRoute 2},
...
{scheduledRoute n}
],
...
},
...
}
The anatomy of scheduledRoutes object looks like this:
"scheduledRoutes":[
{
"uuid": "3f2ba31c-e061-4e1a-82a2-d97a8396be66",
"activeRouteSolution":
{
"drivingTime": 6127,
"distance": 41728,
"stopsCount": 74,
"active": true,
"polyline": "otvvuAbscxkC~a@sb@...",
"workingTime": 6327,
"load": 100,
"transportationMode": "car",
"totalIdleTime": 0,
"routeTimeline":
[
...
],
"violations":
[]
}
}
]
uuid | String Uuid | An internal unique identifier for the Routific engine |
activeRouteSolution | Object | This object outlines the details of Route |
drivingTime | Number | Total time expected to be spent by drivers driving to each location in the route, expressed in seconds |
distance | Number | Total distance expected to travelled by the driver of the route, expressed in meters |
stopsCount | Number | Total number of stops that the driver needs to make as part of the route |
polyline | String | An encoded polyline string representing the route a driver needs to take to complete the stops. Check out this article for more information on decoding polylines. |
workingTime | Number | Total time expected to be spent by the driver to service the entire route, expressed in seconds |
load | Number | Total load of all the packages that need to be delivered as part of the route |
transportationMode | String | Mode of transportation used to calculate a solution for the route |
totalIdleTime | Number | Total time spent idling by the driver due to time-window restrictions of the orders, expressed in seconds |
routeTimeline | Array of Objects | An array representing the timeline of events in the route. The events are chronologically sequenced |
Parsing the routeTimeline array
The routeTimeline field is an array representing a timeline of events for a given route. This timeline consists of four types of events that can take place within a route sequence for a driver.
leaving_start_location event indicates the time at which driver should being his route based on their start location.
delivering_stop event is used to identify the total time taken to service a given order
idling event indicates that the driver is simply waiting to deliver the next order due to time-window constraint
reaching_end_location event indicates the time at which the driver will finish his/her route and reach the end location, if applicable.