Skip to content

Commit

Permalink
refactor of post-processing
Browse files Browse the repository at this point in the history
 - moves collapse into a dedicated set of functions / files
 - make collapse scenarios distinct (slight performance cost)
 - reduce verbosity for short name segments (now actually working, was supposed to do so before)
  • Loading branch information
Moritz Kobitzsch authored and Patrick Niklaus committed Feb 25, 2017
1 parent 8d83c3a commit 6c3390f
Show file tree
Hide file tree
Showing 59 changed files with 1,992 additions and 1,337 deletions.
44 changes: 22 additions & 22 deletions features/bicycle/area.feature
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ Feature: Bike - Squares and other areas
| abcda | (nil) | parking |

When I route I should get
| from | to | route |
| x | y | xa,abcda,by,by |
| y | x | by,abcda,xa,xa |
| a | b | abcda,abcda |
| a | d | abcda,abcda |
| b | c | abcda,abcda |
| c | b | abcda,abcda |
| c | d | abcda,abcda |
| d | c | abcda,abcda |
| d | a | abcda,abcda |
| a | d | abcda,abcda |
| from | to | route |
| x | y | xa,abcda,by |
| y | x | by,abcda,xa |
| a | b | abcda,abcda |
| a | d | abcda,abcda |
| b | c | abcda,abcda |
| c | b | abcda,abcda |
| c | d | abcda,abcda |
| d | c | abcda,abcda |
| d | a | abcda,abcda |
| a | d | abcda,abcda |


@train @platform
Expand All @@ -99,14 +99,14 @@ Feature: Bike - Squares and other areas
| abcda | (nil) | platform |

When I route I should get
| from | to | route |
| x | y | xa,abcda,by,by |
| y | x | by,abcda,xa,xa |
| a | b | abcda,abcda |
| a | d | abcda,abcda |
| b | c | abcda,abcda |
| c | b | abcda,abcda |
| c | d | abcda,abcda |
| d | c | abcda,abcda |
| d | a | abcda,abcda |
| a | d | abcda,abcda |
| from | to | route |
| x | y | xa,abcda,by |
| y | x | by,abcda,xa |
| a | b | abcda,abcda |
| a | d | abcda,abcda |
| b | c | abcda,abcda |
| c | b | abcda,abcda |
| c | d | abcda,abcda |
| d | c | abcda,abcda |
| d | a | abcda,abcda |
| a | d | abcda,abcda |
22 changes: 11 additions & 11 deletions features/bicycle/bridge.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Feature: Bicycle - Handle cycling
Scenario: Bicycle - Use a ferry route
Given the node map
"""
a b c
d
e f g
a b c
d
e f g
"""

And the ways
Expand All @@ -19,22 +19,22 @@ Feature: Bicycle - Handle cycling
| efg | primary | | |

When I route I should get
| from | to | route | modes |
| from | to | route | modes |
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
| e | c | cde,cde | cycling,cycling |
| e | c | cde,cde | cycling,cycling |
| e | b | cde,abc,abc | cycling,cycling,cycling |
| e | a | cde,abc,abc | cycling,cycling,cycling |
| c | e | cde,cde | cycling,cycling |
| c | e | cde,cde | cycling,cycling |
| c | f | cde,efg,efg | cycling,cycling,cycling |
| c | g | cde,efg,efg | cycling,cycling,cycling |

Scenario: Bicycle - Properly handle durations
Given the node map
"""
a b c
d
e f g
a b c
d
e f g
"""

And the ways
Expand All @@ -45,7 +45,7 @@ Feature: Bicycle - Handle cycling

When I route I should get
| from | to | route | modes | speed |
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 4 km/h |
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 6 km/h |
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
| c | e | cde,cde | cycling,cycling | 2 km/h |
| e | c | cde,cde | cycling,cycling | 2 km/h |
4 changes: 2 additions & 2 deletions features/bicycle/names.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Feature: Bike - Street names in instructions
| bc | Your Way | A7 |

When I route I should get
| from | to | route | ref |
| a | c | My Way,Your Way,Your Way | A6,A7,A7 |
| from | to | route | ref |
| a | c | My Way,Your Way | A6,A7 |

@unnamed
Scenario: Bike - No longer use way type to describe unnamed ways, see #3231
Expand Down
1 change: 1 addition & 0 deletions features/bicycle/restrictions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Feature: Bike - Turn restrictions

Background:
Given the profile "bicycle"
Given a grid size of 200 meters

@no_turning
Scenario: Bike - No left turn
Expand Down
15 changes: 8 additions & 7 deletions features/bicycle/turn_penalty.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Feature: Turn Penalties

Background:
Given the profile "turnbot"
Given a grid size of 200 meters

Scenario: Bike - turns should incur a delay that depend on the angle

Expand All @@ -26,10 +27,10 @@ Feature: Turn Penalties

When I route I should get
| from | to | route | time | distance |
| s | a | sj,ja,ja | 39s +-1 | 242m +-1 |
| s | b | sj,jb,jb | 30s +-1 | 200m +-1 |
| s | c | sj,jc,jc | 29s +-1 | 242m +-1 |
| s | d | sj,jd,jd | 20s +-1 | 200m +-1 |
| s | e | sj,je,je | 29s +-1 | 242m +-1 |
| s | f | sj,jf,jf | 30s +-1 | 200m +-1 |
| s | g | sj,jg,jg | 39s +-1 | 242m +-1 |
| s | a | sj,ja,ja | 63s +-1 | 483m +-1 |
| s | b | sj,jb,jb | 50s +-1 | 400m +-1 |
| s | c | sj,jc,jc | 54s +-1 | 483m +-1 |
| s | d | sj,jd,jd | 40s +-1 | 400m +-1 |
| s | e | sj,je,je | 53s +-1 | 483m +-1 |
| s | f | sj,jf,jf | 50s +-1 | 400m +-1 |
| s | g | sj,jg,jg | 63s +-1 | 483m +-1 |
11 changes: 6 additions & 5 deletions features/car/bridge.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Feature: Car - Handle driving

Background:
Given the profile "car"
Given a grid size of 200 meters

Scenario: Car - Use a ferry route
Given the node map
Expand Down Expand Up @@ -45,10 +46,10 @@ Feature: Car - Handle driving

When I route I should get
| from | to | route | modes | speed | time |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 12 km/h | 173s +-1 |
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 162s +-1 |
| c | e | cde,cde | driving,driving | 5 km/h | 146s +-1 |
| e | c | cde,cde | driving,driving | 5 km/h | 149s +-1 |
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 13 km/h | 340s +-1 |
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 318s +-1 |
| c | e | cde,cde | driving,driving | 5 km/h | 295s +-1 |
| e | c | cde,cde | driving,driving | 5 km/h | 295s +-1 |

Scenario: Car - Properly handle durations
Given the node map
Expand All @@ -61,7 +62,7 @@ Feature: Car - Handle driving
And the ways
| nodes | highway | bridge | duration |
| abc | primary | | |
| cde | primary | movable | 00:05:00 |
| cde | primary | movable | 00:10:00 |
| efg | primary | | |

When I route I should get
Expand Down
10 changes: 5 additions & 5 deletions features/car/names.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Feature: Car - Street names in instructions
| bc | Your Way | A1 |

When I route I should get
| from | to | route | ref |
| a | c | My Way,Your Way,Your Way | ,A1,A1|
| from | to | route | ref |
| a | c | My Way,Your Way | ,A1|

Scenario: Car - A named street with pronunciation
Given the node map
Expand All @@ -36,9 +36,9 @@ Feature: Car - Street names in instructions
| cd | Your Way | yourewaye | |

When I route I should get
| from | to | route | pronunciations | ref |
| a | d | My Way,My Way,My Way | ,meyeway,meyeway | ,A1,A1 |
| 1 | c | Your Way,Your Way | yourewaye,yourewaye | , |
| from | to | route | pronunciations | ref |
| a | d | My Way,My Way | ,meyeway | ,A1 |
| 1 | c | Your Way,Your Way | yourewaye,yourewaye | , |

# See #2860
Scenario: Car - same street name but different pronunciation
Expand Down
10 changes: 5 additions & 5 deletions features/car/traffic_turn_penalties.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ Feature: Traffic - turn penalties
Scenario: Weighting not based on turn penalty file
When I route I should get
| from | to | route | speed | weight | time |
| a | h | ad,dhk,dhk | 65 km/h | 11s +-1 | 11s +-1 |
| a | h | ad,dhk | 65 km/h | 11s +-1 | 11s +-1 |
# straight
| i | g | fim,fg,fg | 55 km/h | 13s +-1 | 13s +-1 |
# right
| a | e | ad,def,def | 44 km/h | 16.3s +-1 | 16.3s +-1 |
# left
| c | g | cd,def,fg,fg | 65 km/h | 22s +-1 | 22s +-1 |
| c | g | cd,def,fg | 65 km/h | 22s +-1 | 22s +-1 |
# double straight
| p | g | mp,fim,fg,fg | 60 km/h | 24s +-1 | 24s +-1 |
# straight-right
Expand Down Expand Up @@ -89,13 +89,13 @@ Feature: Traffic - turn penalties
And the contract extra arguments "--turn-penalty-file {penalties_file}"
When I route I should get
| from | to | route | speed | weight | time |
| a | h | ad,dhk,dhk | 65 km/h | 11 | 11s +-1 |
| a | h | ad,dhk | 65 km/h | 11 | 11s +-1 |
# straight
| i | g | fim,fg,fg | 56 km/h | 12.8 | 12s +-1 |
# right - ifg penalty
| a | e | ad,def,def | 67 km/h | 10.8 | 10s +-1 |
# left - faster because of negative ade penalty
| c | g | cd,def,fg,fg | 65 km/h | 22 | 22s +-1 |
| c | g | cd,def,fg | 65 km/h | 22 | 22s +-1 |
# double straight
| p | g | mp,fim,fg,fg | 61 km/h | 23.8 | 23s +-1 |
# straight-right - ifg penalty
Expand All @@ -105,7 +105,7 @@ Feature: Traffic - turn penalties
# double right - forced left by lkh penalty
| g | n | fg,fim,mn,mn | 28 km/h | 51.8 | 51s +-1 |
# double left - imn penalty
| j | c | jk,klm,fim,def,cd,cd | 53 km/h | 54.6 | 54s +-1 |
| j | c | jk,klm,fim,def,cd | 53 km/h | 54.6 | 54s +-1 |
# double left - hdc penalty ever so slightly higher than imn; forces all the way around

Scenario: Too-negative penalty clamps, but does not fail
Expand Down
1 change: 1 addition & 0 deletions features/foot/area.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Feature: Foot - Squares and other areas

Background:
Given the profile "foot"
Given a grid size of 200 meters

@square
Scenario: Foot - Route along edge of a squares
Expand Down
1 change: 1 addition & 0 deletions features/foot/names.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Feature: Foot - Street names in instructions

Background:
Given the profile "foot"
Given a grid size of 200 meters

Scenario: Foot - A named street
Given the node map
Expand Down
1 change: 1 addition & 0 deletions features/foot/restrictions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Foot - Turn restrictions

Background:
Given the profile "foot"
Given a grid size of 200 meters

@no_turning
Scenario: Foot - No left turn
Expand Down
22 changes: 11 additions & 11 deletions features/guidance/anticipate-lanes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -297,19 +297,19 @@ Feature: Turn Lane Guidance
"""

And the ways
| nodes | turn:lanes:forward | name |
| ab | | main |
| bc | left\|through\|through\|through\|right | main |
| cd | left\|through\|right | main |
| de | | main |
| cf | | off |
| ch | | off |
| dg | | off |
| di | | off |
| nodes | turn:lanes:forward | name | destination | oneway |
| ab | | main | One | yes |
| bc | left\|through\|through\|through\|right | main | One | yes |
| cd | left\|through\|right | main | Two | yes |
| de | | main | Three | yes |
| cf | | off | | yes |
| ch | | off | | yes |
| dg | | off | | yes |
| di | | off | | yes |

When I route I should get
| waypoints | route | turns | lanes |
| a,e | main,main,main | depart,use lane straight,arrive | ,left:false straight:false straight:true straight:false right:false, |
| waypoints | route | turns | destinations | lanes | locations |
| a,e | main,main,main | depart,use lane straight,arrive | One,Two,Three | ,left:false straight:false straight:true straight:false right:false, | a,c,e |

@anticipate
Scenario: Anticipate Lanes for through and collapse multiple use lanes
Expand Down
4 changes: 2 additions & 2 deletions features/guidance/bugs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Feature: Features related to bugs
| e | traffic_signals |

When I route I should get
| waypoints | route | turns |
| 1,2 | top,right,right | depart,new name right,arrive |
| waypoints | route | turns |
| 1,2 | top,right | depart,arrive |

@3156
Scenario: Incorrect lanes tag
Expand Down
Loading

0 comments on commit 6c3390f

Please sign in to comment.