Repository navigation
Fixes wrong routing occurring when stall on demand is used with virtual via-nodes. - #1581
Conversation
Signed-off-by: easbar <[email protected]>
Signed-off-by: easbar <[email protected]>
Signed-off-by: easbar <[email protected]>
…nding test. Signed-off-by: easbar <[email protected]>
Signed-off-by: easbar <[email protected]>
Signed-off-by: easbar <[email protected]>
Signed-off-by: easbar <[email protected]>
| EdgeIterator iter = edgeExplorer.setBaseNode(entry.adjNode); | ||
| while (iter.next()) { | ||
| // no need to inspect the edge we are coming from | ||
| if (iter.getEdge() == entry.adjNode) { |
There was a problem hiding this comment.
First I was hoping this might improve performance, but not really. In the iter.getEdge() == entry.adjNode case adjNode.weight+weighting.calcWeight always exactly equals entry.weight below and in this case we never want to stall.
There was a problem hiding this comment.
Oh this was a stupid error, it should be entry.edge instead of entry.adjNode, fixed in ec01e5e
Signed-off-by: easbar <[email protected]>
| IntsRef flags = edge31.getFlags(); | ||
| carEncoder.getAverageSpeedEnc().setDecimal(false, flags, 22); | ||
| edge31.setFlags(flags); | ||
| edge31.set(carEncoder.getAverageSpeedEnc(), 22); |
There was a problem hiding this comment.
This is the 'new' & right way to do it, right ? very nice!
| if (current >= 0 && current < edges.size()) { | ||
| return "virtual edge: " + edges.get(current) + ", all: " + edges.toString(); | ||
| } else { | ||
| return "virtual edge: (invalid)" + ", all: " + edges.toString(); |
There was a problem hiding this comment.
Shouldn't this better throw an IllegalStateException?
There was a problem hiding this comment.
No I don't think so because current=-1 is the state the iterator is in before calling next() for the first time.
|
Will cherry-pick for 0.12 too |
…al via-nodes. (#1581) * Adds integration test showing bug. Signed-off-by: easbar <[email protected]> * Adds unit test explaining the issue. Signed-off-by: easbar <[email protected]> * Adds query point to QueryResult.toString(); Signed-off-by: easbar <[email protected]> * Puts integration test into separate file and adds random graph bug finding test. Signed-off-by: easbar <[email protected]> * Fixes the issue by using epsilon for floating point comparison. Signed-off-by: easbar <[email protected]> * Fixes forgotten node 8 in test and query graph test (toString()). Signed-off-by: easbar <[email protected]> * Minor renames & comments. Signed-off-by: easbar <[email protected]> * Cleans-up setting edge speed. Signed-off-by: easbar <[email protected]>
|
See also ec01e5e |
…al via-nodes. (graphhopper#1581) * Adds integration test showing bug. Signed-off-by: easbar <[email protected]> * Adds unit test explaining the issue. Signed-off-by: easbar <[email protected]> * Adds query point to QueryResult.toString(); Signed-off-by: easbar <[email protected]> * Puts integration test into separate file and adds random graph bug finding test. Signed-off-by: easbar <[email protected]> * Fixes the issue by using epsilon for floating point comparison. Signed-off-by: easbar <[email protected]> * Fixes forgotten node 8 in test and query graph test (toString()). Signed-off-by: easbar <[email protected]> * Minor renames & comments. Signed-off-by: easbar <[email protected]> * Cleans-up setting edge speed. Signed-off-by: easbar <[email protected]>
Fixes #1574.
I added a test that creates random routing situations including ones that lead to wrong routing results (sometimes connection not found but also wrong weights). This PR also adds a failing integration test and a specific test with only 10 nodes that shows the problem in detail (also see comments in #1574).
This PR fixes all these tests and also the random test did not fail after running it for more than 15 minutes.
The performance measurements on the Germany map showed that the query performance before and after this fix is the same.
When I was experimenting with the the random test I ran into two more (probably very rare) error situations: #1582, #1583