Repository navigation
Conversation
DijkstraBidirectionRef and AStarBidirection. In order to share code, the present routing algorithms can now switch between both node-based and edge-based behavior. Tests of those algorithms are executed for each of the traversal modes using parametrized tests. Additionally, the adapted algorithms now consider turn restrictions/costs if the graph stores them in its extended storage. However, tests for turn restrictions/costs have not been written yet.
|
Thanks a lot! I'll have a look. I'm not sure if I understand the test thing. In one sentence you say some test fail in the next you say "have not been written yet". Do you mean existing test break and new are not written? If so, I would rather tend to have both fixed before merge. Or is it not possible yet to test turn stuff? |
|
There are tests which cover the edge-based behavior, in order to make sure that edge-based traversal leads to same routes as the node-based variant. Some of those tests regarding bi-directional algorithms are broken, but I assume there is something wrong with QueryGraph but I did not discover what exactelly the problem is. |
|
#163 should be fixed before adding edge-based algorithms. |
DijkstraBidirectionRef and AStarBidirection. In order to share code, the present routing algorithms can now switch between both node-based and edge-based behavior. Tests of those algorithms are executed for each of the traversal modes using parametrized tests. Additionally, the adapted algorithms now consider turn restrictions/costs if the graph stores them in its extended storage. However, tests for turn restrictions/costs have not been written yet.
Conflicts: core/src/main/java/com/graphhopper/routing/AStarBidirection.java core/src/main/java/com/graphhopper/routing/Dijkstra.java core/src/main/java/com/graphhopper/routing/DijkstraBidirectionRef.java core/src/test/java/com/graphhopper/util/InstructionListTest.java
|
I think we need "tests which cover turn restrictions in the routing process" before merging this ... when I wanted to see make this happen, what do I need to enable? Like turn weighting etc ... some more questions:
|
|
Hi Peter and Karl, I am using the turn restrictions and I added a test for it - I am trying since a couple of hours to make a pull request to khuebner/graphhopper without success. I will go back to it on Monday but if you wish to have a look at it in the meantime the diff is there: The diff contains one test (RoutingAlgorithmIT.testMoscowTurnRestrictions) for the turn restrictions together with fixes in AStar and Fast/ShortWeighting. All tests are running, but there are 2 'cheatings':
Regards |
|
Hey, I really appreciate your hacking on this and I hope to get time next week to review it.
This is commented out because it does not support the QueryGraph (GPS exact routing)
For CH to work we need dijkstraOneToMany to work with turn restrictions. astarbi+dijkstrbi may fail due to the bug Karl mentioned #163 ... in some weeks I'll have more time to finally start hacking on these all issues. |
|
Looking into this stuff now see https://github.com/graphhopper/graphhopper/tree/turn_costs ... but will take some time ;) |
|
Hi Peter, thanks for looking at it. In our prod we are using a different One2Many that supports turn restrictions but it is based on complete rewrite of the Dijkstra and uses our own classes so it is probably of little use to you, however if you would like to see the code I will be glad to share it. Bruno |
|
Merged in #238 where also the follow up will happen - thanks again! |
This pull requests contents changes in AStar, Djikstra, DijkstraBidirectionRef and AStarBidirection which let those algorithms traverse edges instead of nodes. The edge-based behavior is necessary in order to fully support turn restrictions and P-turns in the resulting paths. Following changes have been made:
The prior implementation used the id of the adjacent node to access the map of shortest weights during traversal. An edge-based version of the same algorithms would use the id of the current edge instead of its adjacent node. Therefore, I added a method
createIdentifier(EdgeIterator)inAbstractRoutingAlgorithmin order to move the desired traversal behavior to the super class. Additionally, the traversal mode can be defined inAbstractRoutingAlgorithm, which is either NODE_BASED (default behavior), EDGE_BASED or EDGE_BASED_DIRECTION_SENSITIVE (description can be found in the source). Several tiny adjustments in the inheriting routing algorithms have been made in order to support the different traversal modes.Tests of those algorithms will be executed for each of the traversal modes by using parameterized tests. However, the bidirectional algorithms fail in three tests. I have no idea why this happens but I tried to describe the problem in the source (see AStarBidirectionTest).
Additionally, the adapted algorithms now consider turn restrictions/costs if the graph stores them in its extended storage. However, tests for turn restrictions/costs have not been written yet. This pull request solely aims to introduce the edge-based behavior to present routing algorithms.