Tour Calculation

Characteristic

Short description

The PTV xRoute service is able to respect provisions on working hours when calculating a route. If this feature is used, the PTV xRoute service considers these provisions by scheduling break and rest periods and by respecting limits on driving times and travel times.

Use

The following technical concept explains how to make the PTV xRoute service regard the working hours. It describes which regulations are supported to which degree, and how to interpret the response.

Detailed Consideration

How to calculate tour information ?

PTV xRoute is able to calculate a routeA route corresponds to a path of a vehicle through the underlying transport network. The main attributes of a route are the distance and the time that the vehicle travels along the path. considering the opening intervals and service time on each waypointA waypoint is a geographic location used to specify start, destination and possible stopovers for a route. and the working hours restrictions.
As a post-processing of a routeClosed A route corresponds to a path of a vehicle through the underlying transport network. The main attributes of a route are the distance and the time that the vehicle travels along the path. calculation, if TourRestrictions are defined, a tour calculation is done. This tour calculation try to insert breaks and rests, taking into account the opening intervals and the service time on waypointsClosed A waypoint is a geographic location used to specify start, destination and possible stopovers for a route., and the defined restrictions.
Even if no valid tour can be calculated (because of the constraints), a response is returned with a reasonable violated solution.

Route response

From the route response point of view, each tour information (break, rest, service period, or waiting period) is returned as a NOT_DRIVING segment.
Thus, it is guarantee that the sum of the travel time of the segments is equal to the total travel time of the route response.
Moreover, the travel time returned in route response is also equal to the tour period returned in the tour report response.

Please note, that COMBINED_TRANSPORT segments are also considered as NOT_DRIVING segments.
The related TOUR_EVENT would be either a WAITING, BREAK, DAILY_RESTClosed REST (Representational State Transfer) represents a World Wide Web paradigm, consisting of constraints to the design of components which results in a better performance and maintainability. or a combination of these.

If several tour information are related to a waypoint (for waiting or service time), only one NOT_DRIVING segment is returned. This segment is always after the waypoint ; i.e. the tour operations start after reaching the waypoint.
However, for consistency reason, for the last waypoint of the route, the tour operations are performed before ; i.e. the NOT_DRIVING segment is before the waypoint.
The two nodes of a NOT_DRIVING segment are always located on the same coordinates ; which means that the vehicleThe term vehicle describes what is being routed or planned for. Vehicles are used in route calculation, distance matrix calculation and effectively also in tour planning. In route calculation, vehicle properties like overall size, weight and speed are in focus. In tour planning, it is vehicle properties like capacity and availability. Commonly a vehicle is motorized, like a truck - including its trailer or a car. However also a bike or even a pedestrian are included in this definition. doesn't move when performing a break, rest, service,...
Moreover, if a NOT_DRIVING segment is linked to a waypoint, the coordinates of its nodes are located on the waypoint.

Relation between tour information and waypoints, nodes, segments and legs

Tour events

To get more information about the calculated tour, it is possible to request the TOUR_EVENT.
The tour events are linked to the first node of the NOT_DRIVING segment. The coordinates of the event refer to the coordinates of this node. But the events will occur during the following segment, depending on the travelTimeFromStart field.

Relation between tour information and route events

Tour report

To get a report about the calculated tour, it is possible to request the tourReport in the ResultFields.
Then, the TourReport is available in the routeResponse. It summarizes the total timings for the tour such as the total serviceTime, the total waitingTime, etc.
Please note that the following relation is always true:

Good to know

Tour restrictions on waypoint

Only OnRoadWaypoints and OffRoadWaypoints can deal with TourStopOptions.
Moreover only StartDurationInterval and StartEndInterval are supported to define the opening intervals on a waypoint.
It is possible to define the behaviour of the driver during the service time. By default, the service time is considered as working time. But, using the flag useServiceTimeForRecreation in the TourStopOptions, the service time will be used for a break, a rest or a waiting.

Tour restrictions on combined transports

By default, the time on combined transportsClosed The combined transport is a form of transport where the vehicle in question does not drive itself but is transported by a boat or by rail (piggyback). is considered as waiting time. The driver is not driving.
In order to allow breaks or daily/weekly rest on combined transports (like ferry), the flag useTimeOnCombinedTransportForRecreation should be set to true in the TourRestrictions.

Working hours regulations

PTV xRoute considers the following Drivers' working Hours:

  • In the European Union, the Regulation (EC) No. 561/2006.
  • In the United States, the Hours of Service Regulation (FMCSA) No. 395/2013.
To get more details, see Driving Time Regulation technical concept.

Depending on the choosen regulation, the break and rest position, start time and duration might change for the same route. Moreover, if it is beneficial, the tour calculation can choose to prolongate a break or a rest, during a service time on a waypoint or on a combined transport.

Time dependency

For technical reasons, only the following time consideration mode are supported:

For no time consideration and optimistic modes, since some rules of the regulations require a starting date, midnight 1/1/1970 is used as the reference date/time. Please note that this reference is taken into account to insert the breaks and rests, but no start time is returned in the tour report response.
SnapshotTimeConsideration, TimeSpanConsideration or ExactTimeConsiderationAtStart are mandatory to handle opening intervals on waypoints. If not set, an exception is thrown.

Maximum driving/travel time

Beside the rules of the choosen regulation, it is possible to set either the maximum travel time and/or the maximum driving time of the route (see TourRestrictions).
If these limitations are not observed, the flag violated is set to true in the tour report response. If tour events are requested, tour violations will be returned.
Moreover, if limits are set in combination with SingleDayWorkingHours, these limits are automatically adjusted regarding the regulation ; i.e. the limit cannot be upper than the regulation.

Rest positions

In case of MultiDayWorkingHours, it is mandatory to set dailyRestPositions to ANYWHERE which is not the default value.
PTV xRoute can only insert breaks into one trip. So the other options are not supported.

Performance consideration

For performance reasons, a sub-optimal result can be returned, especially if the best result would require that a break or rest should be taken very soon in the route. A recreation may still not be considered if the service time is short compared to the duration of the recreation and/or the driver has not driven/worked much since the last recreation.

Technical Concept Working Hours
Technical Concept Driving Time Regulation
Showcase Routing with Tour information
Showcase Consider route events