driver_break
A driver_break
object represents a driver break that must be taken by the driver.
RouteCloud can automatically insert driver breaks into routes. Breaks can be specified as non-relative or relative. Non-relative breaks always start at the same time each day. Relative breaks start at a time offset from the shift start time of the route.
Breaks always happen at the specified break.start time. If a break occurs during a job the break object is placed on the route_response.stops list after the job.
Breaks are created only for the duration of a route. For example, if a route starts at 11:00 AM and finishes at 2:00 PM, a 10:00 AM or 3:00 PM break is ignored.
Name | Type | Description |
---|---|---|
earliest_start | timespan | Used for flexible break scheduling. The break can start anytime between earliest_start and latest_start . Do not set "start" when using flexible scheduling. If route.breaks_relative_to_start is set, the earliest_start time is relative to the route start time. |
id | string | An ID assigned to the break. Can be used for integration with other systems. |
latest_start | timespan | Used for flexible break scheduling. The break can start anytime between earliest_start and latest_start . Do not set "start" when using flexible scheduling. If route.breaks_relative_to_start is set, the latest_start time is relative to the route start time. |
length | timespan | The duration of the break. |
name | string | The display name for the break. This must be unique among the breaks on each shift or route. |
start | timespan | The start time of the break. The break is placed at this time. If route.breaks_relative_to_start is set, the start time of the break is relative to the route start time. |
Example
Sending the following build request to RouteCloud:
{
"routes": [
{
"id": "route0_route_with_relative_breaks",
"location": "39.718005, -104.969531",
"start_time": "09:00",
"breaks": [
{ "id": "route0_morning_break", "start": "02:00", "length": "00:15" },
{ "id": "route0_lunch_break", "start": "04:00", "length": "00:30" },
{ "id": "route0_afternoon_break", "start": "06:00", "length": "00:15" }
],
"breaks_relative_to_start": "true"
}
],
"jobs": [
{ "id": "job0", "location": "39.635928, -105.049219" },
{ "id": "job1", "time_on_site": "01:00", "location": "39.725375, -104.791080" },
{ "id": "job2", "time_on_site": "01:00", "location": "39.708990, -105.026954" },
{ "id": "job3", "time_on_site": "01:00", "location": "39.653975, -105.093750" }
]
}
Yields the following response:
{
"id": "route0_route_with_relative_breaks", ...
"stops": [
{ "type": "depot", ... },
{ "id": "job1", "arrival_time": "09:26:58", "time_on_site": "01:00:00", ... },
{
"type": "break",
"id": "route0_morning_break",
"arrival_time": "11:00:00",
"time_on_site": "00:15:00",
"distance_to_meters": 0.0,
"time_to": "00:00:00"
},
{ "id": "job0", "arrival_time": "11:16:44", "time_on_site": "00:00:00", ... },
{ "id": "job3", "arrival_time": "11:26:12", "time_on_site": "01:00:00", ... },
{ "id": "job2", "arrival_time": "12:41:30", "time_on_site": "01:00:00", ... },
{
"type": "break",
"id": "route0_lunch_break",
"arrival_time": "13:00:00",
"time_on_site": "00:30:00",
"distance_to_meters": 0.0,
"time_to": "00:00:00"
},
{ "type": "depot", "arrival_time": "14:23:20", ... }
]
}
See Also
- Routing with Driver Breaks.
- The route.breaks field.