On Friday, February 1, 2013 7:39:29 PM UTC+1, Rheinhesse wrote:
But perhaps you want to check wether it's an expected and explainable behaviour for the Brouter-Algorithm. In the testcase, with trekking.brf a route from A to B is calculated correctly. As soon as I simply move A a little farther away, the route is calculated with a small and unnecessary detour.
Hi Rupert,
well - I can explain, but have to dig a little deeper into the elevation formula.
I count eleavtion penanlty for the downhill-part, not uphill. It doesn't really matter (what goes up must go down), but this way I can prefer slow descends versus steep descends, because for slow descends you get your energy back.
Then I use a hysteris-band of 10m height: as long as elevation variation happens within this band, I don't count elevation penalty. But having such a hysteris-band implies having a hidden state variable which I call the "elevation hysteris buffer", short EHB, which is a number in the range between 0m and 10m. And having such a hidden state variable implies having a "dislocality". At Track start I set EHB=0. When you go down 10m, you have EHB=10, but not yet added any elevation penalty to the total cost. That makes the difference between your two tracks, because you prepended a 10m downhill section, so at their common starting point one has EHB=0, the other EHB=10.
But why can this difference influence a routing descion more than 1000m away? One more detail on how I prefer slow descends versus steep descends: I subtract 1,5% of the traveled distance from the EHB, thus making 1,5% descend "free" and only what's above adds to the total cost. This is also needed to prevent glitches in flat, urban regions where elevation "variations" are mostly form builings, not from hills - this 1,5% just lowers the chance that you will ever add elevation penalty in flat, urban regions.
But in your "slow-descend example" shit happens: with "your" 1,5% average descend and "my" 1,5% subtraction you have exaclty the case where an EHB-difference can be propagated over a long distance.
And with 1,5% free descend and "eleavtion_cost=66" I am at the limit where traveled distance can become invariant, because for a detour the saving in elevation penalty can equal the cost of the addional distance (1/66 = 1,5%!). This is what happened in your example (because you are at costfactor=1, turncost=0 for the long-distance cycleroutes).
So in summary: yes, it's a glitch, but it's in the formula, it's not a bug in the processing engine.