Fix ambiguity in edge weights by using minimal weight
This commit is contained in:
parent
b00b15ab98
commit
e17b306265
@ -251,3 +251,18 @@ Feature: Basic Routing
|
||||
| from | to | route |
|
||||
| d | c | de,ce,ce |
|
||||
| e | d | de,de |
|
||||
|
||||
Scenario: Ambiguous edge weights - Use minimal edge weight
|
||||
Given the node map
|
||||
| a | b |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| ab | tertiary | |
|
||||
| ab | primary | |
|
||||
| ab | secondary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| a | b | , | 10s |
|
||||
| b | a | , | 10s |
|
||||
|
@ -453,11 +453,13 @@ void ExtractionContainers::PrepareEdges(lua_State *segment_state)
|
||||
all_edges_list[i].result.weight < min_forward_weight)
|
||||
{
|
||||
min_forward_idx = i;
|
||||
min_forward_weight = all_edges_list[i].result.weight;
|
||||
}
|
||||
if (all_edges_list[i].result.backward &&
|
||||
all_edges_list[i].result.weight < min_backward_weight)
|
||||
{
|
||||
min_backward_idx = i;
|
||||
min_backward_weight = all_edges_list[i].result.weight;
|
||||
}
|
||||
|
||||
// this also increments the outer loop counter!
|
||||
|
Loading…
Reference in New Issue
Block a user