How to obtain driver break coordinates when using xTour/planTours

This forum deals with any kind of trip optimization based on xTour1, xTour2 and the Developer APIs "RouteOptimization" and "SequenceOptimization". No matter whether it is automatic planning or manual dispatching, refering to transport orders or service planning.
Attention: this does not refer to PTV Optiflow SaaS and PTV Developer RouteOptimization Optiflow.
Post Reply
CAPcargo
Posts: 54
Joined: Tue May 19, 2015 12:53 pm

How to obtain driver break coordinates when using xTour/planTours

Post by CAPcargo »

Hi,

When we call xTour/planTours with a driver breaks configuration, the response may contain planned breaks. However, the response does not include the actual coordinates where the break occurs. Instead, it only provides the driving time from the previous stop.

This creates a limitation in our system because we cannot display the driver break location on our map.

While investigating alternative approaches, we noticed that xRoute/calculateRoute does return coordinates for breaks (under Route events):

Image


Based on this, we considered the following approach:
  • Call xTour/planTours and obtain the planned tour result.
  • Identify waypoint pairs where a break occurs between two stops.
  • For each such pair, call xRoute/calculateRoute.
  • Extract the break coordinate from the xRoute response and use it in our system.
  • To ensure that the break is inserted at exactly the same point as in the original xTour planning, we set:
    • The same break configuration as the xTour request plus
    • TourRestrictions/WorkLogbookSummary/configurableWorkingHoursLogbookSummary/accumulatedDrivingTimeSinceLastBreak
    to the driving time already completed up to the first waypoint in the xRoute call.
    This ensures that the break is inserted at the same moment in the route as it was planned by xTour/planTours.
We tested this approach using the Raw Request Runner, and the results were consistent:
xRoute placed the breaks at exactly the same times as those generated by the original xTour request, while also providing the coordinates we needed.

:?: Our question is the following:
  • Is this the recommended approach according to the API design, or have we possibly missed a simpler or more direct method for obtaining break coordinates when using xTour/planTours?

Marko Arsovski,
CAPcargo
Attachments
xRoute.png
User avatar
Bernd Welter
Site Admin
Posts: 3035
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: How to obtain driver break coordinates when using xTour/planTours

Post by Bernd Welter »

Hello Marko,

your approach sounds valid to me. Please be aware of the following comments:
  • xTour2 is not aware of underlying geometries of routes - it simply uses the traveltimes / distances given by xDima2's matrices. Therefore xtour2 cannot return exact positions.
  • Under some circumstances the traveltimes / distances of a Matrix based call could differ from the KPIs returned by a 1:1 routing. This is in fact quite often happening when you apply CONVENTIONAL routing instead of HIGH_PERFORMANCE_ROUTING. :!: To minimize gaps you are recommended to use the same HPR for the xDima2 and xRoute2 calls.
Best regards,
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply