-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Work towards removing TurnWeighting #1842
Conversation
# Conflicts: # core/src/main/java/com/graphhopper/routing/weighting/AbstractAdjustedWeighting.java # web-bundle/src/main/java/com/graphhopper/resources/InfoResource.java
Can we merge this ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -37,6 +39,8 @@ | |||
*/ | |||
double getMinWeight(double distance); | |||
|
|||
double calcEdgeWeight(EdgeIteratorState edgeState, boolean reverse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add javadocs? And highlight the difference to calcWeight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, good point!
This is some preliminary work for #1820, mainly to reduce the diff when we actually fix #1820.
INFINITE_U_TURN_COSTS
constant intoWeighting
.Weighting#calcEdgeWeight/Millis
. For now this is a pure convenience method that just callscalcWeight
withprevOrNext=-1
. For Remove TurnWeighting #1820 this will be the other way around: InAbstractWeighting
we will havecalcWeight
which usescalcEdgeWeight
and addscalcTurnWeight
. Subclasses will then only overridecalcEdgeWeight/Millis
and leave the turn cost calculation toAbstractWeighting
. The turn cost calculation can then be adjusted by changing theTurnCostProvider
implementation which is passed toAbstractWeighting
via its constructor (at least this is what I currently think we should do).FlagEncoder#supports(TurnWeighting.class)
withFlagEncoder#supportsTurnCosts()
. Note that this it what it was like before 0.4 according to the changelogThe actual work for #1820 is happening here: https://github.com/graphhopper/graphhopper/tree/remove_turn_weighting, but its not in (near) a mergeable state yet.
Any thoughts ?