Page 1 of 1

xRoute1.enforceShortestRoute and it's side effects...

Posted: Fri Apr 25, 2025 11:02 am
by Bernd Welter
Hi there,

recently I introduced some players in the xRoute1 profile parameter Routing.Course.enforceShortestRoute:
Defines if a shortest route should be enforced. Its effect is that all segment-specific bonus and malus values are set to zero and the search space is extended indefinitely. If this parameter is set to true, the setting of BonusMalus and of LevellingScopeByNetworkClass has no effect.
Looks like this parameter might need some specific explanation / info: When set to TRUE
  • it disables Levelling (ignores all NC Scopes)
  • it overrides NC penalties
  • it DOES NOT overide the distanceTimeWeighting / OPTIMIZATION: you are still expected to set one of these values to a small value. Keep the priority of the parameters in xServer1 mind:
    • Highest: RoutingOption...
    • CallerContext : XML Snippet (compareable to xServer2 Request Profile)
    • CallerContext : referenced profile (compareable to xServer2 StoredProfile)
    • Engine defaults...
    So if you set RoutingOption.OPTIMIZATION=80 and at the same time specify the xml Snippet "distanceTimeWeighting=90" then the effective value would be 80.
Further URLs:
:!: I'd recommend to be very careful when applying this parameter. Due to the side effects mentioned above the returned routes might be "legal" (not violated) but practically unuseable: usually there's a good reason to perform local detours around urban areas, restricted delivery only, pedestrian zones...)
:!: We usually recommend to use values somewhere between 20 and 90 (percent) to avoid these extreme results.
Just some more info about the linear balance between distance and time aka OPTIMIZATION and distanceTimeWeightiing... The map and charts show various routings from Barcelona to Athens. I iterated over the OPTIMIZATION = 0, 5, 10, 15, ... and you can see that depending on this value you can choose between a fancy cruise through the mediterranian sea (distance = few hundred kilometers, almost 3 days) or a scenic route through the countryside (less than 2 days but more than 3000km).<br />(xRoute2 based screenshot)
Just some more info about the linear balance between distance and time aka OPTIMIZATION and distanceTimeWeightiing... The map and charts show various routings from Barcelona to Athens. I iterated over the OPTIMIZATION = 0, 5, 10, 15, ... and you can see that depending on this value you can choose between a fancy cruise through the mediterranian sea (distance = few hundred kilometers, almost 3 days) or a scenic route through the countryside (less than 2 days but more than 3000km).
(xRoute2 based screenshot)