Page 1 of 1

How to get break generated from ConfigurableWorkingHoursPreset

Posted: Mon Dec 30, 2024 4:24 pm
by CAPcargo
Hi,

I`ve started testing the ConfigurableWorkingHoursPreset parameter which can be set for:
  • xTour/planTours
  • xRoute/calculateRoute
For both services I`ve used the EU_DRIVING_TIME_REGULATION_FOR_SINGLE_DAY option.

My test on xTour/planTours (Fleet/Drivers/ConfigurableWorkingHoursPreset) went fine -> a break was added in the response before the 4.5h continuous driving time.

But when I try to use the same setup in xRoute/calculateRoute (RouteOption/TourRestrictions/ConfigurableWorkingHoursPreset) I cannot see any clear data in the response indicating where the break was added.

The only place in the xRoute response that I`ve noticed something related to the break is in the segments:
NotDrivingSegmentType.png
which according to the Segment type documentation it can represent a driver break.

After I removed the ConfigurableWorkingHoursPreset option, this segment type was removed as well proving that it was added by it.

My question is actually how can I determine after which waypoint the break is appears in xRoute?
I was expecting the following:
  • A new waypoint is added representing the break`s location
  • A break tour event included in the Route event
My end goal is after I get the xRoute response which contains the newly added break to update my local tour with it.

I`ve attached the xRoute/calculateRoute request xml file. The response file is too large to be uploaded as it is so I`ve removed most of the segment nodes.

Re: How to get break generated from ConfigurableWorkingHoursPreset

Posted: Mon Dec 30, 2024 6:12 pm
by frs
Hi,

the tour and waypoint events can be requested by setting the corresponding event types in the resultFields element, for example:

Code: Select all

      <eventTypes>WAYPOINT_EVENT</eventTypes>
      <eventTypes>TOUR_EVENT</eventTypes>
With the attached example request extended by those event types the events contain the following:

Code: Select all

      <events xsi:type="ns3:WaypointEvent" waypointIndex="3" eventType="WAYPOINT_EVENT" startsAt="2019-03-02T16:52:08.694+01:00" distanceFromStart="229741.0" travelTimeFromStart="14432.694">
        <coordinate x="9.2634599529" y="47.411409972"/>
      </events>
      <events xsi:type="ns3:TourEvent" duration="0.0" eventType="TOUR_EVENT" startsAt="2019-03-02T16:52:08.694+01:00" distanceFromStart="229741.0" travelTimeFromStart="14432.694">
        <coordinate x="9.2634599529" y="47.411409972"/>
        <tourEventTypes>SERVICE</tourEventTypes>
      </events>
      <events xsi:type="ns3:TourEvent" duration="2700.0" eventType="TOUR_EVENT" startsAt="2019-03-02T17:21:36.000+01:00" distanceFromStart="254830.0" travelTimeFromStart="16200.0">
        <coordinate x="9.4798974041" y="47.361411827"/>
        <tourEventTypes>BREAK</tourEventTypes>
      </events>
So the break event is around 25km after the waypoint with index 3: the events are in the order of the route and by those events it is possible to find out where the break is scheduled w.r.t. the waypoints. Note that there are also service tour events which are normally at the same position as the corresponding waypoint event. For the last waypoint there is an exception for the order of the service and waypoint events, for the last waypoint the waypoint event is always after the service tour event.

The observation that there is a NOT_DRIVING segment with the duration of the break as travel time is correct. If also the nodes are requested in the result fields, for each event we return also the node index which can be used to identify the corresponding node (and hence also the segment).

For more details see also the technical concept on Tour Calculation.

Hope that helps and best regards,

Frank

Re: How to get break generated from ConfigurableWorkingHoursPreset

Posted: Tue Dec 31, 2024 12:42 pm
by CAPcargo
Hi Frank,

Thank you for your response; it was very helpful. I have the wanted response data now.

Best regards,
Marko Arsovski