Impact of RoutingOptions / RequestProfile to HPR calculation
Posted: Thu Jul 18, 2024 7:25 am
Hi there,
you never stop learning. And yesterday I learned about the impact of some parameters on the calculation of HighPermformanceRoutingNetworks in terms of
you never stop learning. And yesterday I learned about the impact of some parameters on the calculation of HighPermformanceRoutingNetworks in terms of
- Memory consumption during the creation and application of an HPR
- Filesizes
- Performance (calculation time of creation method)
- What happened so far: player started a HPR creation and faced an error after 45% - result was
Code: Select all
{ "id": "b727a49a-bfc8-4eeb-aff3-165d7564119a", "status": "FAILED", "progress": { "$type": "HighPerformanceRoutingNetworkProgress", "status": "GENERATING_NETWORK", "progress": 45 }, "elapsedTime": 3734774 }
Code: Select all
fetchHighPerformanceRoutingNetworkResponse liefert: { "faultInfo": { "$type": "InternalErrorFault" }, "message": "Error communicating with backend module m0001." }
- After analysis : create request treid to apply special com.ptvgroup.xserver.routingprofile.TurnStrategy which was commented by Development:
using the turn strategy leads to bigger HPR networks as can be seen in the following screenshot for Luxembourg:The increase is by a factor of about 3.3. Why is this the case?
In the routing without a custom turn strategy turns at intersection are not treated at all. Of course, banned turns are treated correctly, but besides that it doesn’t matter for the route calculation if it’s a left turn, a right turn or just straight ahead. That changes as soon as a custom turn strategy is used. To prefer passenger side turns, it is now important for the route calculation to distinguish between a left turn and a right turn.
Hence, the underlying data structures become bigger. Not only does the final HPR network become bigger, but also the required hardware resources to generate the HPR network increases. It takes longer to generate, and I observed that the memory consumption for the module that runs the requests went up to as much as 112 GB and took more than 3 hours to complete for the request. The resulting network has a size of about 18 GB, which is somewhat expected as HPR networks for Europe usually have about 5 GB of size.
Parameter | Consequence |
---|---|
com.ptvgroup.xserver.routingprofile.TurnStrategy.PREFER_PASSENGER_SIDE_TURNS | requires more hardware (both memory and filespace), slows down calculation time |
com.ptvgroup.xserver.routing.GeographicRestrictions | Used to reduce the total volume of relevant segments on a sigificant level, e.g. from "wholw rorld map to Europe" or "from Whole world map to ["DE","CH","AT"]. Very positive impact on performance and memory consumption. Only meaningful if business allows the functional apect (routes are never leaving the described area) match. |