2016-04-29 03:48:13 -04:00
|
|
|
@routing @speed @traffic
|
|
|
|
Feature: Traffic - turn penalties applied to turn onto which a phantom node snaps
|
|
|
|
|
|
|
|
Background: Simple map with phantom nodes
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
1 2 3
|
|
|
|
a b c d
|
|
|
|
|
|
|
|
e f g
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | id |
|
|
|
|
| a | 1 |
|
|
|
|
| b | 2 |
|
|
|
|
| c | 3 |
|
|
|
|
| d | 4 |
|
|
|
|
| e | 5 |
|
|
|
|
| f | 6 |
|
|
|
|
| g | 7 |
|
|
|
|
|
2016-04-29 03:48:13 -04:00
|
|
|
And the ways
|
|
|
|
| nodes | highway |
|
|
|
|
| ab | primary |
|
|
|
|
| bc | primary |
|
|
|
|
| cd | primary |
|
|
|
|
|
|
|
|
| be | primary |
|
|
|
|
| cf | primary |
|
|
|
|
| dg | primary |
|
|
|
|
And the profile "testbot"
|
|
|
|
# Since testbot doesn't have turn penalties, a penalty from file of 0 should produce a neutral effect
|
|
|
|
|
|
|
|
Scenario: Weighting based on turn penalty file, with an extreme negative value -- clamps and does not fail
|
|
|
|
Given the turn penalty file
|
|
|
|
"""
|
2016-08-12 13:12:55 -04:00
|
|
|
1,2,5,0,comment
|
2016-05-12 12:50:10 -04:00
|
|
|
3,4,7,-30
|
2016-04-29 03:48:13 -04:00
|
|
|
"""
|
2016-09-19 17:13:44 -04:00
|
|
|
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
2017-03-14 10:39:59 -04:00
|
|
|
And the customize extra arguments "--turn-penalty-file {penalties_file}"
|
|
|
|
|
2016-04-29 03:48:13 -04:00
|
|
|
When I route I should get
|
2016-05-12 12:50:10 -04:00
|
|
|
| from | to | route | speed | time |
|
|
|
|
| a | e | ab,be,be | 36 km/h | 40s +-1 |
|
|
|
|
| 1 | e | ab,be,be | 36 km/h | 30s +-1 |
|
|
|
|
| b | f | bc,cf,cf | 36 km/h | 40s +-1 |
|
|
|
|
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 |
|
2022-08-27 06:36:20 -04:00
|
|
|
| c | g | cd,dg,dg | 72 km/h | 20s +-1 |
|
2016-05-12 12:50:10 -04:00
|
|
|
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 |
|
|
|
|
|
|
|
|
Scenario: Weighting based on turn penalty file with weights
|
|
|
|
Given the turn penalty file
|
|
|
|
"""
|
|
|
|
1,2,5,0,-3.33,comment
|
|
|
|
3,4,7,-30,100.75
|
|
|
|
"""
|
|
|
|
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
2017-03-14 10:39:59 -04:00
|
|
|
And the customize extra arguments "--turn-penalty-file {penalties_file}"
|
|
|
|
|
2016-05-12 12:50:10 -04:00
|
|
|
When I route I should get
|
|
|
|
| from | to | route | speed | time | weights |
|
|
|
|
| a | e | ab,be,be | 36 km/h | 40s +-1 | 16.7,20,0 |
|
2022-08-19 17:31:40 -04:00
|
|
|
| 1 | e | ab,be,be | 36 km/h | 30s +-1 | 6.8,20,0 |
|
2016-05-12 12:50:10 -04:00
|
|
|
| b | f | bc,cf,cf | 36 km/h | 40s +-1 | 20,20,0 |
|
2022-08-19 17:31:40 -04:00
|
|
|
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 | 10.1,20,0 |
|
2022-08-27 06:36:20 -04:00
|
|
|
| c | g | cd,dg,dg | 72 km/h | 20s +-1 | 120.8,20,0 |
|
2022-08-19 17:31:40 -04:00
|
|
|
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 | 110.9,20,0 |
|