2016-07-19 04:30:11 -04:00
|
|
|
@routing @testbot @sidebias
|
|
|
|
Feature: Testbot - side bias
|
|
|
|
|
2016-09-26 16:25:54 -04:00
|
|
|
Background:
|
|
|
|
Given the profile file
|
|
|
|
"""
|
|
|
|
require 'testbot'
|
|
|
|
properties.left_hand_driving = true
|
|
|
|
"""
|
|
|
|
|
2016-07-19 04:30:11 -04:00
|
|
|
Scenario: Left hand bias
|
2016-05-12 12:50:10 -04:00
|
|
|
Given the profile file "car" extended with
|
2016-09-26 16:25:54 -04:00
|
|
|
"""
|
|
|
|
properties.left_hand_driving = true
|
2016-05-12 12:50:10 -04:00
|
|
|
turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
|
2016-09-26 16:25:54 -04:00
|
|
|
"""
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c
|
|
|
|
|
|
|
|
d
|
|
|
|
"""
|
2016-07-19 04:30:11 -04:00
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bc |
|
|
|
|
| bd |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route | time |
|
2016-05-12 12:50:10 -04:00
|
|
|
| d | a | bd,ab,ab | 29s +-1 |
|
|
|
|
| d | c | bd,bc,bc | 33s +-1 |
|
2016-07-19 04:30:11 -04:00
|
|
|
|
|
|
|
Scenario: Right hand bias
|
2016-05-12 12:50:10 -04:00
|
|
|
Given the profile file "car" extended with
|
2016-09-26 16:25:54 -04:00
|
|
|
"""
|
|
|
|
properties.left_hand_driving = false
|
2016-05-12 12:50:10 -04:00
|
|
|
turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
|
2016-09-26 16:25:54 -04:00
|
|
|
"""
|
2016-07-19 04:30:11 -04:00
|
|
|
And the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c
|
|
|
|
|
|
|
|
d
|
|
|
|
"""
|
2016-07-19 04:30:11 -04:00
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bc |
|
|
|
|
| bd |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route | time |
|
2016-05-12 12:50:10 -04:00
|
|
|
| d | a | bd,ab,ab | 33s +-1 |
|
|
|
|
| d | c | bd,bc,bc | 29s +-1 |
|
2016-07-19 04:30:11 -04:00
|
|
|
|
|
|
|
Scenario: Roundabout exit counting for left sided driving
|
|
|
|
And a grid size of 10 meters
|
|
|
|
And the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a
|
|
|
|
b
|
|
|
|
h g c d
|
|
|
|
e
|
|
|
|
f
|
|
|
|
"""
|
2016-09-26 16:25:54 -04:00
|
|
|
And the ways
|
2016-07-19 04:30:11 -04:00
|
|
|
| nodes | junction |
|
|
|
|
| ab | |
|
|
|
|
| cd | |
|
|
|
|
| ef | |
|
|
|
|
| gh | |
|
|
|
|
| bcegb | roundabout |
|
|
|
|
|
2016-09-26 16:25:54 -04:00
|
|
|
When I route I should get
|
2016-07-29 15:35:01 -04:00
|
|
|
| waypoints | route | turns |
|
|
|
|
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
|
|
|
|
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
|
|
|
|
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
|