Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can a profile specify different costs for left and right turns? #110

Open
lpirl opened this issue Aug 20, 2018 · 9 comments
Open

Can a profile specify different costs for left and right turns? #110

lpirl opened this issue Aug 20, 2018 · 9 comments

Comments

@lpirl
Copy link

lpirl commented Aug 20, 2018

This would probably be useful for routing in urban areas, where turning right is oftentimes much easier/quicker than turning left (the other way around for left-hand traffic).
Maybe some users would want to configure turning right at traffic lights to be as cheap as there would be no traffic light at all. :)

@poutnikl
Copy link
Contributor

poutnikl commented Aug 21, 2018

Aside of the implementation, how would you decide algorithmically ? As there is huge difference in crossing turn parameters, affecting the cost value, mainly traffic, geometry, orientation and priority.

I guess, before serious consideration by the developer, a draft of a crossing turning cost model is IMHO needed.

From other point of view, there is already crossingless turning cost.
Proper value, slightly increased above the simple geometrical turncost may eliminate the need of left/right crossing turn cost, as their deviations will cancel each other.

@poutnikl
Copy link
Contributor

poutnikl commented Aug 21, 2018

E.g if geometrical turncoat was 90, rightturn crossing cost was 150, left one 300,
Using effective common turncost somewhere between 120-180 may fit .
Optimal value depends on curve/crossing ratio.

@abrensch
Copy link
Owner

Are you talking about bikes or cars?

The kinematical model for car-routing has already some symmetry-breaking, when crossing straight, the speed constraint may be different whether a street is joing from the left or from the right:

Look here for "leftWaySpeed":

https://github.com/abrensch/brouter/blob/master/brouter-core/src/main/java/btools/router/KinematicPath.java

However, there are not yet assymetric values here, because there' no concpt for left- or right-handes traffic up to now.

@lpirl
Copy link
Author

lpirl commented Aug 21, 2018

First of all, thanks for joining the discussion.
Well, I am obviously not enough into routing to answer all the follow up questions.

I am talking about bicycles.
In urban areas, turning left on crossing with traffic lights is very expensive, since you usually have to cross two streets (involves waiting :)). Turning right, in contrast, is usually possible without any waiting at all.

I thought of something like this:
Suppose a turn at a crossing has a fixed cost, e.g., 50
{or a cost factor [0;1], e.g., .2}.
Now, left turns could have a higher cost (e.g., 60) and right turns a lower cost (e.g., 40)
{or factor .3 for right and .1 for left turns}.

Considering the angle here would be more advanced but might be not even needed,
since it is just about having to cross approaching traffic.

Oh maybe that would be an alternative: penalties for crossing approaching traffic and penalties for crossing cross traffic.
I wouldn't be too sure if it is more expensive with out without traffic lights.

@lpirl
Copy link
Author

lpirl commented Aug 21, 2018

Regarding the awareness of left- and right-hand traffic:
if the routing engine has no understanding of these concepts, the profiles could (with the obvious limitation that profiles for left-hand traffic could not be used for right-hand traffic and vice versa).
However, the alternative mentioned above (i.e., "a penalty for crossing other traffic lanes"), would eliminate the need for distinguishing between left. and right-hand traffic, no?

@poutnikl
Copy link
Contributor

Hm , as there is statistically about the same number of both L/R types, 40/60 will be more expensive than 50/50 with about the same result.

As penalties are to be point like, it would not make sense to touch cost factor, related to the way segment length. Rather to be applied in node context. Neither the way initialcost applies easily, as the cost is context dependent.

Profiles are part of the routing engine. They cannot be aware of what
the engine cannot be aware of.

@lpirl
Copy link
Author

lpirl commented Sep 6, 2018

Thanks @poutnikl for the explanations.
I am apparently not enough into routing engines (i.e., not at all) to oversee why penalties for crossing other traffic lines could not work well or easily.
If you folks don't see any possibility or other approach to take into account (routing-wise) that crossing other traffic tends to be expensive, feel free to close this issue then.

@NotAFile
Copy link

This is unfortunately the one area where BRouter delivers suboptimal results for me. It often instructs me to turn left on multi lane roads where I would usually avoid turning left at all costs for safety reasons. I think making that decision well would require better mapping of bicycle turning lanes though.

@poutnikl
Copy link
Contributor

The best is going just straight ahead or turning right, going in clockwise closed cycles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants