Governments impose rules how long a truck driver can drive before he needs to rest. Routing can consider these regulations w.r.t. short rests during a day and long (overnight) rests.
For example, in EU countries drivers have to rest after 4.5 hours of driving for at least 45 minutes, and must not exceed a total of 9 working hours per day, before they have to rest for 11 hours.
Activate this feature in the router using the "&restTimes=local" request parameter. Routing will then consider each country's local regulations.
In the same parameter you can specify whether the driver starts the route freshly or how long he is already driving / on duty since his last short or long rest period.
The rest time rules can distinguish between totally elapsed time between rests and time actually driven (not standing still, not unloading goods...), because the country wide regulations are using both variants.
Explicit rule specification has following 10 elements:
Routing doesn't try to use more fine grained rules for optimization, e.g. the EU rule that the 45 minute short rest can be divided into a 15 minute break followed by a 30 minute break. But Route Match is aware of this rule when creating driver rest time violation warnings.
Explicit rule specification examples:
European regulation. After 4.5 hours driven rest for 45 mintues. After 9 hours elapsed rest for 11 hours.
USA regulation. After 8 hours time rest for 30 mintues. After 14 hours or 11 hours driven rest for 10 hours. Last long (and hence also short) rest was 2 hours ago:
Routing tries to combine other wait times with legal driver rest times:
If a waypoint has a "stopOverDelay" where part of it qualifies as driver rest time (parameter "stopOverDelayRestTime") then routing checks whether it should take the next upcoming driver rest already at this point to save time.
If the vehicle has to wait on a condition (roads not accessible for a few hours, weekend truck bans ...) then routing checks whether it should take the next upcoming driver rest already at this point to save time.
If the vehicle has idle time during a longer ferry ride then routing checks whether it should take the next upcoming driver rest already at this point to save time.
Routing always checks all alternative options to combine a wait time with an earlier rest and chooses the combination that results in the overall fastest route and meets all deadlines and opening hours at the waypoints. This functionality works for routing with given departure time, with given arrival time and without departure/arrival specification.
A special case are waiting times for ferry departures. Routing neither knows the exact ferry departure schedules nor the departure time that the driver has booked. Hence, the waiting time - including automatic combination of waiting time with legal rest time by the router - must be modeled as an addiitonal waypoint at the ferry terminal, in the routing call, along with the "opening" and "closing" time parameters for the ferry departure.