Page 1 of 1
Determine the latest departure times of stations
Posted: Fri Jul 15, 2022 11:19 am
by kevinkrueger
Now, to output our departure times to our stations, we specified "ExactTimeConsiderationAtArrival" in the route calculation. Thereby we got the following error message:
"ExactTimeConsiderationAtArrival mode can not be used if TourRestrictions are requested.".
How can I solve this problem?
Re: Determine the latest departure times of stations
Posted: Mon Jul 18, 2022 11:54 am
by Bernd Welter
Hello Kevin,
in fact this error occurs because we do not compute the break- and rest rules while we create the route from the "reverse angle". Technically this would be possible but in such a case we would start to insert the breaks in the wrong way:
Imagine a driver who is completely refreshed but who needs a break after 4:30 hours.
- Forward: based on a refreshed driver in ExactAtStart mode. This structure is what you'd like to get.
With "ExactAtArrival" we would insert the "first" break 4:30 back from the ArrivalTime and so on.
The output route of such an approach would probably display the "early" breaks way too early.
- Now in this case I simulated the expected output with an (impossible) combination of "ExactAtArrival" and "Break- and Restrule of a refreshed driver". The first break occurs somewhere after 2:00 hours which is wrong.
What you could do to solve this: Apply an iterative approach
- Perform a ExactAtStart-Routing with a reference time almost as the desired "arrival time".
- Use the output arrival time to determine a "shift" period
- Calculate the route again in "ExactAtStart"-Mode but translate the "start time"
Not the perfect solution but for most cases good enough.
Best regards,
Bernd
PS:
This video shows how we flood the network in a unidirectional case (such as ExactAtStart and ExactAtArrival).
Re: Determine the latest departure times of stations
Posted: Thu Dec 22, 2022 3:06 pm
by Bernd Welter
quick update... though the following request does not mention "TourOptions" it fails with an
Code: Select all
<soap:Text xml:lang="en">ExactTimeConsiderationAtArrival mode can not
be used if TourRestrictions are requested.</soap:Text>
Request:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://xroute.xserver.ptvgroup.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body> <startCalculateRoute xmlns="http://xroute.xserver.ptvgroup.com">
<request storedProfile="car" xmlns="">
<requestProfile userLanguage="DE">
<featureLayerProfile>
<themes id="PTV_TruckAttributes" enabled="false" />
<themes id="PTV_TrafficIncidents" enabled="false" />
<themes id="PTV_TruckSpeedPatterns" enabled="false" />
</featureLayerProfile>
<routingProfile>
<course distanceTimeWeighting="80" />
</routingProfile>
</requestProfile>
<waypoints xmlns:q1="http://xroute.xserver.ptvgroup.com" xsi:type="q1:OffRoadWaypoint" name="1">
<location>
<offRoadCoordinate x="8.9" y="47.74" />
</location>
<tourStopOptions serviceTime="900" />
</waypoints>
<waypoints xmlns:q2="http://xroute.xserver.ptvgroup.com" xsi:type="q2:OffRoadWaypoint" name="2">
<location>
<offRoadCoordinate x="8.05" y="48.63" />
</location>
<tourStopOptions serviceTime="900" />
</waypoints>
<routeOptions currency="EUR">
<timeConsideration xmlns:q3="http://timeconsideration.xserver.ptvgroup.com" xsi:type="q3:ExactTimeConsiderationAtArrival" referenceTime="2022-12-22T00:00:00" />
</routeOptions>
<resultFields waypoints="true" nodes="true" polyline="true" tourReport="true" encodedPath="true" monetaryCostsReport="true">
<legs enabled="true" polyline="true" tollSummary="true" emissions="true" />
<segments enabled="true" emissions="true" polyline="true" descriptors="true" roadAttributes="true" id="true" />
<eventTypes>TOUR_EVENT</eventTypes>
<eventTypes>WAYPOINT_EVENT</eventTypes>
<eventTypes>ROUTE_VIOLATION_EVENT</eventTypes>
<eventTypes>TOLL_EVENT</eventTypes>
<toll enabled="true" sections="true" systems="true" />
</resultFields>
</request>
</startCalculateRoute>
</soap:Body>
</soap:Envelope>
Took me a few seconds to spot the various implicit causes:
- The waypoints contain tourStopOptions.
- The resultFields ask for tourReport="true"
- The resultFields ask for <eventTypes>TOUR_EVENT</eventTypes>
Each one of these triggers the error in this case.
Bernd