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

turn penalties #240

Closed
wants to merge 1 commit into from
Closed

turn penalties #240

wants to merge 1 commit into from

Conversation

emiltin
Copy link
Contributor

@emiltin emiltin commented May 2, 2012

this commit implements a simple turn penalty formula that squares the turn angle (where straight ahead is 0, uturn is 180), scales it and multiplies it with the "turnPenalty" speedprofile setting. in addition you can set "turnBias" to make left turns more expensive than right turns (or the other way around). 1 (or leaving it out) means no bias.

this seems to work quite well. it really helps to smooth out routes a bit - you avoid overly wriggly routes with a minimal increase in length.

"turnPenalty" or "turnBias" can be left out in the speedprofile in case you don't want to incur turn penalties.

@DennisOSRM
Copy link
Collaborator

Cool, will have a look tomorrow.

@emiltin
Copy link
Contributor Author

emiltin commented May 3, 2012

the turnPenalty setting is adjusted to be the distance that will be added for a 90 degree turn with bias 1.
suggested settings (for bikes, left side driving) are included in speedprofiles/bicycle.ini:

turnPenalty = 50
turnBias = 1.4

@emiltin
Copy link
Contributor Author

emiltin commented May 3, 2012

if you're routing across several countries, some might have left side driving, and others right side. i suppose the bias would have to be left out in this case. otherwise you would need some way of setting the bias for each way depending on country.

@emiltin
Copy link
Contributor Author

emiltin commented May 29, 2012

#167

@DennisOSRM
Copy link
Collaborator

Will be fixed or at least fixable with the implementation of issue #1

@emiltin
Copy link
Contributor Author

emiltin commented Jun 5, 2012

looking forward to trying it out

@DennisOSRM
Copy link
Collaborator

Will be fixed with implementation of issue #1. Therefore closing as duplicate.

@DennisOSRM DennisOSRM closed this Jul 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants