2014-10-09 08:30:06 -04:00
|
|
|
@routing @penalty @signal @testbot
|
2012-03-08 02:37:41 -05:00
|
|
|
Feature: Penalties
|
2014-03-27 16:46:53 -04:00
|
|
|
# Testbot uses a signal penalty of 7s.
|
2012-09-28 10:47:44 -04:00
|
|
|
|
2013-08-29 13:29:13 -04:00
|
|
|
Background:
|
|
|
|
Given the profile "testbot"
|
|
|
|
|
|
|
|
Scenario: Traffic signals should incur a delay, without changing distance
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c
|
|
|
|
d e f
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | highway |
|
|
|
|
| e | traffic_signals |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| abc |
|
|
|
|
| def |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 20:20:03 -04:00
|
|
|
| from | to | route | time | distance |
|
|
|
|
| a | c | abc,abc | 20s +-1 | 200m +-1 |
|
|
|
|
| d | f | def,def | 27s +-1 | 200m +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Signal penalty should not depend on way type
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c
|
|
|
|
d e f
|
|
|
|
g h i
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | highway |
|
|
|
|
| b | traffic_signals |
|
|
|
|
| e | traffic_signals |
|
|
|
|
| h | traffic_signals |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | highway |
|
|
|
|
| abc | primary |
|
|
|
|
| def | secondary |
|
|
|
|
| ghi | tertiary |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 20:20:03 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| a | c | abc,abc | 27s +-1 |
|
|
|
|
| d | f | def,def | 47s +-1 |
|
|
|
|
| g | i | ghi,ghi | 67s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Passing multiple traffic signals should incur a accumulated delay
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c d e
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | highway |
|
|
|
|
| b | traffic_signals |
|
|
|
|
| c | traffic_signals |
|
|
|
|
| d | traffic_signals |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| abcde |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 20:20:03 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| a | e | abcde,abcde | 61s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
@todo
|
|
|
|
Scenario: Signal penalty should not depend on way type
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c
|
|
|
|
d e f
|
|
|
|
g h i
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | highway |
|
|
|
|
| b | traffic_signals |
|
|
|
|
| e | traffic_signals |
|
|
|
|
| h | traffic_signals |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | highway |
|
|
|
|
| abc | primary |
|
|
|
|
| def | secondary |
|
|
|
|
| ghi | tertiary |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 20:20:03 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| a | b | abc,abc | 10s +-1 |
|
|
|
|
| a | c | abc,abc | 27s +-1 |
|
|
|
|
| d | e | def,def | 20s +-1 |
|
|
|
|
| d | f | def,def | 47s +-1 |
|
|
|
|
| g | h | ghi,ghi | 30s +-1 |
|
|
|
|
| g | i | ghi,ghi | 67s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Passing multiple traffic signals should incur a accumulated delay
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c d e
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | highway |
|
|
|
|
| b | traffic_signals |
|
|
|
|
| c | traffic_signals |
|
|
|
|
| d | traffic_signals |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| abcde |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 20:20:03 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| a | e | abcde,abcde | 61s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
@todo
|
|
|
|
Scenario: Starting or ending at a traffic signal should not incur a delay
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | highway |
|
|
|
|
| b | traffic_signals |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| abc |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route | time |
|
|
|
|
| a | b | abc | 10s +-1 |
|
|
|
|
| b | a | abc | 10s +-1 |
|
|
|
|
|
|
|
|
Scenario: Routing between signals on the same way should not incur a delay
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | highway |
|
|
|
|
| a | traffic_signals |
|
|
|
|
| d | traffic_signals |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | highway |
|
|
|
|
| abcd | primary |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 20:20:03 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| b | c | abcd,abcd | 10s +-1 |
|
|
|
|
| c | b | abcd,abcd | 10s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Prefer faster route without traffic signals
|
|
|
|
Given a grid size of 50 meters
|
|
|
|
And the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c
|
|
|
|
d
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | highway |
|
|
|
|
| b | traffic_signals |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | highway |
|
|
|
|
| abc | primary |
|
|
|
|
| adc | primary |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 20:20:03 -04:00
|
|
|
| from | to | route |
|
|
|
|
| a | c | adc,adc |
|