2014-10-09 08:30:06 -04:00
|
|
|
@routing @time @testbot
|
2012-02-19 14:36:29 -05:00
|
|
|
Feature: Estimation of travel time
|
2014-03-27 16:46:53 -04:00
|
|
|
# Testbot speeds:
|
|
|
|
# Primary road: 36km/h = 36000m/3600s = 100m/10s
|
|
|
|
# Secondary road: 18km/h = 18000m/3600s = 100m/20s
|
|
|
|
# Tertiary road: 12km/h = 12000m/3600s = 100m/30s
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Background: Use specific speeds
|
|
|
|
Given the profile "testbot"
|
|
|
|
|
|
|
|
Scenario: Basic travel time, 10m scale
|
|
|
|
Given a grid size of 10 meters
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
h a b
|
|
|
|
g x c
|
|
|
|
f e d
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
2014-04-02 09:52:26 -04:00
|
|
|
| nodes | highway |
|
|
|
|
| xa | primary |
|
|
|
|
| xb | primary |
|
|
|
|
| xc | primary |
|
|
|
|
| xd | primary |
|
|
|
|
| xe | primary |
|
|
|
|
| xf | primary |
|
|
|
|
| xg | primary |
|
|
|
|
| xh | primary |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:56:50 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| x | a | xa,xa | 1s +-1 |
|
|
|
|
| x | b | xb,xb | 1s +-1 |
|
|
|
|
| x | c | xc,xc | 1s +-1 |
|
|
|
|
| x | d | xd,xd | 1s +-1 |
|
|
|
|
| x | e | xe,xe | 1s +-1 |
|
|
|
|
| x | f | xf,xf | 1s +-1 |
|
|
|
|
| x | g | xg,xg | 1s +-1 |
|
|
|
|
| x | h | xh,xh | 1s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Basic travel time, 100m scale
|
|
|
|
Given a grid size of 100 meters
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
h a b
|
|
|
|
g x c
|
|
|
|
f e d
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
2014-04-02 09:52:26 -04:00
|
|
|
| nodes | highway |
|
|
|
|
| xa | primary |
|
|
|
|
| xb | primary |
|
|
|
|
| xc | primary |
|
|
|
|
| xd | primary |
|
|
|
|
| xe | primary |
|
|
|
|
| xf | primary |
|
|
|
|
| xg | primary |
|
|
|
|
| xh | primary |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:56:50 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| x | a | xa,xa | 10s +-1 |
|
|
|
|
| x | b | xb,xb | 14s +-1 |
|
|
|
|
| x | c | xc,xc | 10s +-1 |
|
|
|
|
| x | d | xd,xd | 14s +-1 |
|
|
|
|
| x | e | xe,xe | 10s +-1 |
|
|
|
|
| x | f | xf,xf | 14s +-1 |
|
|
|
|
| x | g | xg,xg | 10s +-1 |
|
|
|
|
| x | h | xh,xh | 14s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Basic travel time, 1km scale
|
|
|
|
Given a grid size of 1000 meters
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
h a b
|
|
|
|
g x c
|
|
|
|
f e d
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
2014-04-02 09:52:26 -04:00
|
|
|
| nodes | highway |
|
|
|
|
| xa | primary |
|
|
|
|
| xb | primary |
|
|
|
|
| xc | primary |
|
|
|
|
| xd | primary |
|
|
|
|
| xe | primary |
|
|
|
|
| xf | primary |
|
|
|
|
| xg | primary |
|
|
|
|
| xh | primary |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:56:50 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| x | a | xa,xa | 100s +-1 |
|
|
|
|
| x | b | xb,xb | 141s +-1 |
|
|
|
|
| x | c | xc,xc | 100s +-1 |
|
|
|
|
| x | d | xd,xd | 141s +-1 |
|
|
|
|
| x | e | xe,xe | 100s +-1 |
|
|
|
|
| x | f | xf,xf | 141s +-1 |
|
|
|
|
| x | g | xg,xg | 100s +-1 |
|
|
|
|
| x | h | xh,xh | 141s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Basic travel time, 10km scale
|
|
|
|
Given a grid size of 10000 meters
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
h a b
|
|
|
|
g x c
|
|
|
|
f e d
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
2014-04-02 09:52:26 -04:00
|
|
|
| nodes | highway |
|
|
|
|
| xa | primary |
|
|
|
|
| xb | primary |
|
|
|
|
| xc | primary |
|
|
|
|
| xd | primary |
|
|
|
|
| xe | primary |
|
|
|
|
| xf | primary |
|
|
|
|
| xg | primary |
|
|
|
|
| xh | primary |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:56:50 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| x | a | xa,xa | 1000s +-1 |
|
|
|
|
| x | b | xb,xb | 1414s +-1 |
|
|
|
|
| x | c | xc,xc | 1000s +-1 |
|
|
|
|
| x | d | xd,xd | 1414s +-1 |
|
|
|
|
| x | e | xe,xe | 1000s +-1 |
|
|
|
|
| x | f | xf,xf | 1414s +-1 |
|
|
|
|
| x | g | xg,xg | 1000s +-1 |
|
|
|
|
| x | h | xh,xh | 1414s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Time of travel depending on way type
|
|
|
|
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 ways
|
|
|
|
| nodes | highway |
|
|
|
|
| ab | primary |
|
|
|
|
| cd | secondary |
|
|
|
|
| ef | tertiary |
|
|
|
|
| ace | something |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:56:50 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| a | b | ab,ab | 10s +-1 |
|
|
|
|
| c | d | cd,cd | 20s +-1 |
|
|
|
|
| e | f | ef,ef | 30s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Time of travel on a series of ways
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b e
|
|
|
|
f c d
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | highway |
|
|
|
|
| ab | primary |
|
|
|
|
| bc | primary |
|
|
|
|
| cd | primary |
|
2016-05-13 13:18:00 -04:00
|
|
|
| be | primary |
|
|
|
|
| cf | primary |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:56:50 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| a | b | ab,ab | 10s +-1 |
|
|
|
|
| a | c | ab,bc,bc | 20s +-1 |
|
|
|
|
| a | d | ab,bc,cd,cd | 30s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Time of travel on a winding way
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a i h
|
|
|
|
b c g
|
|
|
|
d e f
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | highway |
|
|
|
|
| abcdefghi | primary |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:56:50 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| a | b | abcdefghi,abcdefghi | 10s +-1 |
|
|
|
|
| a | e | abcdefghi,abcdefghi | 40s +-1 |
|
|
|
|
| a | i | abcdefghi,abcdefghi | 80s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Time of travel on combination of road types
|
|
|
|
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 ways
|
2014-04-02 09:52:26 -04:00
|
|
|
| nodes | highway |
|
|
|
|
| abc | primary |
|
|
|
|
| cde | tertiary |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:56:50 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| b | c | abc,abc | 10s +-1 |
|
|
|
|
| c | e | cde,cde | 60s +-1 |
|
|
|
|
| b | d | abc,cde,cde | 40s +-1 |
|
|
|
|
| a | e | abc,cde,cde | 80s +-1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Scenario: Time of travel on part of a way
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a 1
|
|
|
|
2
|
|
|
|
3
|
|
|
|
b 4
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | highway |
|
|
|
|
| ab | primary |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:56:50 -04:00
|
|
|
| from | to | route | time |
|
|
|
|
| 1 | 2 | ab,ab | 10s +-1 |
|
|
|
|
| 1 | 3 | ab,ab | 20s +-1 |
|
|
|
|
| 1 | 4 | ab,ab | 30s +-1 |
|
|
|
|
| 4 | 3 | ab,ab | 10s +-1 |
|
|
|
|
| 4 | 2 | ab,ab | 20s +-1 |
|
|
|
|
| 4 | 1 | ab,ab | 30s +-1 |
|
2014-05-27 10:54:10 -04:00
|
|
|
|
2014-04-02 09:52:26 -04:00
|
|
|
Scenario: Total travel time should match sum of times of individual ways
|
|
|
|
Given a grid size of 1000 meters
|
|
|
|
And the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b
|
|
|
|
|
|
|
|
c d
|
|
|
|
"""
|
2014-04-02 09:52:26 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | highway |
|
|
|
|
| ab | primary |
|
|
|
|
| bc | primary |
|
|
|
|
| cd | primary |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:56:50 -04:00
|
|
|
| from | to | route | distances | distance | times | time |
|
|
|
|
| a | b | ab,ab | 1000m +-1 | 1000m +-1 | 100s +-1 | 100s +-1 |
|
|
|
|
| b | c | bc,bc | 2000m +-1 | 2000m +-1 | 200s +-1 | 200s +-1 |
|
|
|
|
| c | d | cd,cd | 3000m +-1 | 3000m +-1 | 300s +-1 | 300s +-1 |
|
|
|
|
| a | c | ab,bc,bc | 1000m,2000m +-1 | 3000m +-1 | 100s,200s +-1 | 300s +-1 |
|
|
|
|
| b | d | bc,cd,cd | 2000m,3000m +-1 | 5000m +-1 | 200s,300s +-1 | 500s +-1 |
|
|
|
|
| a | d | ab,bc,cd,cd | 1000m,2000m,3000m +-1 | 6000m +-1 | 100s,200s,300s +-1 | 600s +-1 |
|