Merge pull request #171 from emiltin/cuke_penalty_tests
tests for signal penalties
This commit is contained in:
commit
24e72bc6cc
@ -2,7 +2,7 @@
|
|||||||
Feature: Handle bad data in a graceful manner
|
Feature: Handle bad data in a graceful manner
|
||||||
|
|
||||||
Scenario: Empty dataset
|
Scenario: Empty dataset
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
|
|
||||||
Given the ways
|
Given the ways
|
||||||
@ -13,7 +13,7 @@ Feature: Handle bad data in a graceful manner
|
|||||||
| a | b | |
|
| a | b | |
|
||||||
|
|
||||||
Scenario: Start/end point at the same location
|
Scenario: Start/end point at the same location
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| 1 | 2 |
|
| 1 | 2 |
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ Feature: Handle bad data in a graceful manner
|
|||||||
| 2 | 2 | |
|
| 2 | 2 | |
|
||||||
|
|
||||||
Scenario: Start/end point far outside data area
|
Scenario: Start/end point far outside data area
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1 |
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1 |
|
||||||
| a | b | | | | | | | | | | | | | | | | | | | | | | | | | | | 2 |
|
| a | b | | | | | | | | | | | | | | | | | | | | | | | | | | | 2 |
|
||||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3 |
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3 |
|
||||||
|
@ -3,7 +3,7 @@ Feature: Basic Routing
|
|||||||
|
|
||||||
@smallest
|
@smallest
|
||||||
Scenario: A single way with two nodes
|
Scenario: A single way with two nodes
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@ -16,7 +16,7 @@ Feature: Basic Routing
|
|||||||
| b | a | ab |
|
| b | a | ab |
|
||||||
|
|
||||||
Scenario: Routing in between two nodes of way
|
Scenario: Routing in between two nodes of way
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b | 1 | 2 | c | d |
|
| a | b | 1 | 2 | c | d |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@ -29,7 +29,7 @@ Feature: Basic Routing
|
|||||||
| 2 | 1 | abcd |
|
| 2 | 1 | abcd |
|
||||||
|
|
||||||
Scenario: Routing between the middle nodes of way
|
Scenario: Routing between the middle nodes of way
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b | c | d | e | f |
|
| a | b | c | d | e | f |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@ -52,7 +52,7 @@ Feature: Basic Routing
|
|||||||
| e | d | abcdef |
|
| e | d | abcdef |
|
||||||
|
|
||||||
Scenario: Two ways connected in a straight line
|
Scenario: Two ways connected in a straight line
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b | c |
|
| a | b | c |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@ -70,7 +70,7 @@ Feature: Basic Routing
|
|||||||
| c | b | bc |
|
| c | b | bc |
|
||||||
|
|
||||||
Scenario: 2 unconnected parallel ways
|
Scenario: 2 unconnected parallel ways
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| c | d |
|
| c | d |
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ Feature: Basic Routing
|
|||||||
| d | a | |
|
| d | a | |
|
||||||
|
|
||||||
Scenario: 3 ways connected in a triangle
|
Scenario: 3 ways connected in a triangle
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | | b |
|
| a | | b |
|
||||||
| | | |
|
| | | |
|
||||||
| | c | |
|
| | c | |
|
||||||
@ -114,7 +114,7 @@ Feature: Basic Routing
|
|||||||
| c | b | bc |
|
| c | b | bc |
|
||||||
|
|
||||||
Scenario: To ways connected at a 45 degree angle
|
Scenario: To ways connected at a 45 degree angle
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | | |
|
| a | | |
|
||||||
| b | | |
|
| b | | |
|
||||||
| c | d | e |
|
| c | d | e |
|
||||||
|
@ -3,7 +3,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: Distance of a winding south-north path
|
Scenario: Distance of a winding south-north path
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| d | c |
|
| d | c |
|
||||||
| e | f |
|
| e | f |
|
||||||
@ -25,7 +25,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: Distance of a winding east-west path
|
Scenario: Distance of a winding east-west path
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | d | e | h |
|
| a | d | e | h |
|
||||||
| b | c | f | g |
|
| b | c | f | g |
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: Distances when traversing part of a way
|
Scenario: Distances when traversing part of a way
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | 0 | 1 | 2 |
|
| a | 0 | 1 | 2 |
|
||||||
| 9 | | | 3 |
|
| 9 | | | 3 |
|
||||||
| 8 | | | 4 |
|
| 8 | | | 4 |
|
||||||
@ -82,7 +82,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: Geometric distances
|
Scenario: Geometric distances
|
||||||
Given a grid size of 1000 meters
|
Given a grid size of 1000 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| v | w | y | a | b | c | d |
|
| v | w | y | a | b | c | d |
|
||||||
| u | | | | | | e |
|
| u | | | | | | e |
|
||||||
| t | | | | | | f |
|
| t | | | | | | f |
|
||||||
@ -147,7 +147,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: 1m distances
|
Scenario: 1m distances
|
||||||
Given a grid size of 1 meters
|
Given a grid size of 1 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| | c |
|
| | c |
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: 10m distances
|
Scenario: 10m distances
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| | c |
|
| | c |
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: 100m distances
|
Scenario: 100m distances
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| | c |
|
| | c |
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: 1km distance
|
Scenario: 1km distance
|
||||||
Given a grid size of 1000 meters
|
Given a grid size of 1000 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| | c |
|
| | c |
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: 10km distances
|
Scenario: 10km distances
|
||||||
Given a grid size of 10000 meters
|
Given a grid size of 10000 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| | c |
|
| | c |
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: 100km distances
|
Scenario: 100km distances
|
||||||
Given a grid size of 100000 meters
|
Given a grid size of 100000 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| | c |
|
| | c |
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: 1000km distances
|
Scenario: 1000km distances
|
||||||
Given a grid size of 1000000 meters
|
Given a grid size of 1000000 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| | c |
|
| | c |
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ Feature: Distance calculation
|
|||||||
|
|
||||||
Scenario: Angles at 1000km scale
|
Scenario: Angles at 1000km scale
|
||||||
Given a grid size of 1000 meters
|
Given a grid size of 1000 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | | | b | | | |
|
| | | | b | | | |
|
||||||
| | | | | | | c |
|
| | | | | | | c |
|
||||||
| a | | | | | | |
|
| a | | | | | | |
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Feature: Handle ferry routes
|
Feature: Handle ferry routes
|
||||||
|
|
||||||
Scenario: Use a ferry route
|
Scenario: Use a ferry route
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b | c | | |
|
| a | b | c | | |
|
||||||
| | | d | | |
|
| | | d | | |
|
||||||
| | | e | f | g |
|
| | | e | f | g |
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Feature: Street names in instructions
|
Feature: Street names in instructions
|
||||||
|
|
||||||
Scenario: A named street
|
Scenario: A named street
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| | c |
|
| | c |
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ Feature: Street names in instructions
|
|||||||
| a | c | My Way,Your Way |
|
| a | c | My Way,Your Way |
|
||||||
|
|
||||||
Scenario: Use way type to describe unnamed ways
|
Scenario: Use way type to describe unnamed ways
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b | c |
|
| a | b | c |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@ -29,7 +29,7 @@ Feature: Street names in instructions
|
|||||||
| a | c | cycleway,trac |
|
| a | c | cycleway,trac |
|
||||||
|
|
||||||
Scenario: Don't create instructions for every node of unnamed ways
|
Scenario: Don't create instructions for every node of unnamed ways
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b | c | d |
|
| a | b | c | d |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
|
@ -15,7 +15,7 @@ Feature: Oneway streets
|
|||||||
| primary | -1 | | x |
|
| primary | -1 | | x |
|
||||||
|
|
||||||
Scenario: Around the Block
|
Scenario: Around the Block
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| d | c |
|
| d | c |
|
||||||
|
|
||||||
|
99
features/penalty.feature
Normal file
99
features/penalty.feature
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
@routing @penalty
|
||||||
|
Feature: Penalties
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the speedprofile "bicycle"
|
||||||
|
And the speedprofile settings
|
||||||
|
| trafficSignalPenalty | 20 |
|
||||||
|
|
||||||
|
Scenario: Passing a traffic signal should incur a delay
|
||||||
|
Given the node map
|
||||||
|
| a | b | c |
|
||||||
|
| d | e | f |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| e | traffic_signals |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abc |
|
||||||
|
| def |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | time |
|
||||||
|
| a | c | abc | 38s |
|
||||||
|
| d | f | def | 58s |
|
||||||
|
|
||||||
|
Scenario: Passing multiple traffic signals should incur a accumulated delay
|
||||||
|
Given the node map
|
||||||
|
| a | b | c | d | e |
|
||||||
|
|
||||||
|
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
|
||||||
|
| from | to | route | time |
|
||||||
|
| a | e | abcde | 136s |
|
||||||
|
|
||||||
|
Scenario: Starting or ending at a traffic signal should not incur a delay
|
||||||
|
Given the node map
|
||||||
|
| a | b | c |
|
||||||
|
|
||||||
|
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 | 19s |
|
||||||
|
| b | a | abc | 19s |
|
||||||
|
| b | c | abc | 19s |
|
||||||
|
| c | b | abc | 19s |
|
||||||
|
|
||||||
|
Scenario: Routing between signals on the same way should not incur a delay
|
||||||
|
Given the node map
|
||||||
|
| a | b | c | d |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| a | traffic_signals |
|
||||||
|
| d | traffic_signals |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abcd |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | time |
|
||||||
|
| b | c | abcd | 19s |
|
||||||
|
| c | b | abcd | 19s |
|
||||||
|
|
||||||
|
Scenario: Prefer faster route without traffic signals
|
||||||
|
Given the node map
|
||||||
|
| a | b | c |
|
||||||
|
| | d | |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | highway |
|
||||||
|
| b | traffic_signals |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes |
|
||||||
|
| abc |
|
||||||
|
| adc |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route |
|
||||||
|
| a | c | adc |
|
@ -8,7 +8,7 @@ Feature: Turn restrictions
|
|||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: No left turn
|
Scenario: No left turn
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | n | |
|
| | n | |
|
||||||
| w | j | e |
|
| w | j | e |
|
||||||
| | s | |
|
| | s | |
|
||||||
@ -32,7 +32,7 @@ Feature: Turn restrictions
|
|||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: No right turn
|
Scenario: No right turn
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | n | |
|
| | n | |
|
||||||
| w | j | e |
|
| w | j | e |
|
||||||
| | s | |
|
| | s | |
|
||||||
@ -56,7 +56,7 @@ Feature: Turn restrictions
|
|||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: No u-turn
|
Scenario: No u-turn
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | n | |
|
| | n | |
|
||||||
| w | j | e |
|
| w | j | e |
|
||||||
| | s | |
|
| | s | |
|
||||||
@ -80,7 +80,7 @@ Feature: Turn restrictions
|
|||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Handle any no_* relation
|
Scenario: Handle any no_* relation
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | n | |
|
| | n | |
|
||||||
| w | j | e |
|
| w | j | e |
|
||||||
| | s | |
|
| | s | |
|
||||||
@ -104,7 +104,7 @@ Feature: Turn restrictions
|
|||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Only left turn
|
Scenario: Only left turn
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | n | |
|
| | n | |
|
||||||
| w | j | e |
|
| w | j | e |
|
||||||
| | s | |
|
| | s | |
|
||||||
@ -128,7 +128,7 @@ Feature: Turn restrictions
|
|||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Only right turn
|
Scenario: Only right turn
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | n | |
|
| | n | |
|
||||||
| w | j | e |
|
| w | j | e |
|
||||||
| | s | |
|
| | s | |
|
||||||
@ -152,7 +152,7 @@ Feature: Turn restrictions
|
|||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Only straight on
|
Scenario: Only straight on
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | n | |
|
| | n | |
|
||||||
| w | j | e |
|
| w | j | e |
|
||||||
| | s | |
|
| | s | |
|
||||||
@ -176,7 +176,7 @@ Feature: Turn restrictions
|
|||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Handle any only_* restriction
|
Scenario: Handle any only_* restriction
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | n | |
|
| | n | |
|
||||||
| w | j | e |
|
| w | j | e |
|
||||||
| | s | |
|
| | s | |
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Feature: Snap start/end point to the nearest way
|
Feature: Snap start/end point to the nearest way
|
||||||
|
|
||||||
Scenario: Snap to nearest protruding oneway
|
Scenario: Snap to nearest protruding oneway
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | 1 | | 2 | |
|
| | 1 | | 2 | |
|
||||||
| 8 | | n | | 3 |
|
| 8 | | n | | 3 |
|
||||||
| | w | c | e | |
|
| | w | c | e | |
|
||||||
@ -28,7 +28,7 @@ Feature: Snap start/end point to the nearest way
|
|||||||
| 8 | c | wc |
|
| 8 | c | wc |
|
||||||
|
|
||||||
Scenario: Snap to nearest edge of a square
|
Scenario: Snap to nearest edge of a square
|
||||||
Given the nodes
|
Given the node map
|
||||||
| 4 | 5 | 6 | 7 |
|
| 4 | 5 | 6 | 7 |
|
||||||
| 3 | a | | u |
|
| 3 | a | | u |
|
||||||
| 2 | | | |
|
| 2 | | | |
|
||||||
@ -47,7 +47,7 @@ Feature: Snap start/end point to the nearest way
|
|||||||
| 7 | b | aub |
|
| 7 | b | aub |
|
||||||
|
|
||||||
Scenario: Snap to edge right under start/end point
|
Scenario: Snap to edge right under start/end point
|
||||||
Given the nodes
|
Given the node map
|
||||||
| d | e | f | g |
|
| d | e | f | g |
|
||||||
| c | | | h |
|
| c | | | h |
|
||||||
| b | | | i |
|
| b | | | i |
|
||||||
@ -75,7 +75,7 @@ Feature: Snap start/end point to the nearest way
|
|||||||
|
|
||||||
Scenario: Snap to correct way at large scales
|
Scenario: Snap to correct way at large scales
|
||||||
Given a grid size of 1000 meters
|
Given a grid size of 1000 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | | | a |
|
| | | | a |
|
||||||
| x | | | b |
|
| x | | | b |
|
||||||
| | | | c |
|
| | | | c |
|
||||||
|
@ -12,7 +12,7 @@ Given /^a grid size of (\d+) meters$/ do |meters|
|
|||||||
set_grid_size meters
|
set_grid_size meters
|
||||||
end
|
end
|
||||||
|
|
||||||
Given /^the nodes$/ do |table|
|
Given /^the node map$/ do |table|
|
||||||
table.raw.each_with_index do |row,ri|
|
table.raw.each_with_index do |row,ri|
|
||||||
row.each_with_index do |name,ci|
|
row.each_with_index do |name,ci|
|
||||||
unless name.empty?
|
unless name.empty?
|
||||||
@ -29,6 +29,16 @@ Given /^the nodes$/ do |table|
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Given /^the nodes$/ do |table|
|
||||||
|
table.hashes.each do |row|
|
||||||
|
name = row.delete 'node'
|
||||||
|
raise "***invalid node name '#{c}', must be single characters" unless name.size == 1
|
||||||
|
node = find_node_by_name(name)
|
||||||
|
raise "*** unknown node '#{c}'" unless node
|
||||||
|
node << row
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Given /^the ways$/ do |table|
|
Given /^the ways$/ do |table|
|
||||||
table.hashes.each do |row|
|
table.hashes.each do |row|
|
||||||
way = OSM::Way.new make_osm_id, OSM_USER, OSM_TIMESTAMP
|
way = OSM::Way.new make_osm_id, OSM_USER, OSM_TIMESTAMP
|
||||||
@ -37,7 +47,7 @@ Given /^the ways$/ do |table|
|
|||||||
nodes = row.delete 'nodes'
|
nodes = row.delete 'nodes'
|
||||||
raise "*** duplicate way '#{nodes}'" if name_way_hash[nodes]
|
raise "*** duplicate way '#{nodes}'" if name_way_hash[nodes]
|
||||||
nodes.each_char do |c|
|
nodes.each_char do |c|
|
||||||
raise "*** node invalid name '#{c}', must be single characters" unless c.size == 1
|
raise "***invalid node name '#{c}', must be single characters" unless c.size == 1
|
||||||
raise "*** ways cannot use numbered nodes, '#{name}'" unless c.match /[a-z]/
|
raise "*** ways cannot use numbered nodes, '#{name}'" unless c.match /[a-z]/
|
||||||
node = find_node_by_name(c)
|
node = find_node_by_name(c)
|
||||||
raise "*** unknown node '#{c}'" unless node
|
raise "*** unknown node '#{c}'" unless node
|
||||||
|
@ -12,7 +12,7 @@ Feature: Estimation of travel time
|
|||||||
|
|
||||||
Scenario: Basic travel time, 1m scale
|
Scenario: Basic travel time, 1m scale
|
||||||
Given a grid size of 1 meters
|
Given a grid size of 1 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| h | a | b |
|
| h | a | b |
|
||||||
| g | x | c |
|
| g | x | c |
|
||||||
| f | e | d |
|
| f | e | d |
|
||||||
@ -41,7 +41,7 @@ Feature: Estimation of travel time
|
|||||||
|
|
||||||
Scenario: Basic travel time, 100m scale
|
Scenario: Basic travel time, 100m scale
|
||||||
Given a grid size of 100 meters
|
Given a grid size of 100 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| h | a | b |
|
| h | a | b |
|
||||||
| g | x | c |
|
| g | x | c |
|
||||||
| f | e | d |
|
| f | e | d |
|
||||||
@ -70,7 +70,7 @@ Feature: Estimation of travel time
|
|||||||
|
|
||||||
Scenario: Basic travel time, 10km scale
|
Scenario: Basic travel time, 10km scale
|
||||||
Given a grid size of 10000 meters
|
Given a grid size of 10000 meters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| h | a | b |
|
| h | a | b |
|
||||||
| g | x | c |
|
| g | x | c |
|
||||||
| f | e | d |
|
| f | e | d |
|
||||||
@ -98,7 +98,7 @@ Feature: Estimation of travel time
|
|||||||
| x | h | xh | 3400s |
|
| x | h | xh | 3400s |
|
||||||
|
|
||||||
Scenario: Time of travel depending on way type
|
Scenario: Time of travel depending on way type
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
| c | d |
|
| c | d |
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ Feature: Estimation of travel time
|
|||||||
| c | d | cd | 72s |
|
| c | d | cd | 72s |
|
||||||
|
|
||||||
Scenario: Time of travel on a series of ways
|
Scenario: Time of travel on a series of ways
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b | c | d |
|
| a | b | c | d |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@ -129,7 +129,7 @@ Feature: Estimation of travel time
|
|||||||
| a | d | ab,bc,cd | 72s |
|
| a | d | ab,bc,cd | 72s |
|
||||||
|
|
||||||
Scenario: Time of travel on a winding way
|
Scenario: Time of travel on a winding way
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b | | | | |
|
| a | b | | | | |
|
||||||
| | c | d | e | | i |
|
| | c | d | e | | i |
|
||||||
| | | | f | g | h |
|
| | | | f | g | h |
|
||||||
@ -145,7 +145,7 @@ Feature: Estimation of travel time
|
|||||||
| a | i | abcdefghi | 192s |
|
| a | i | abcdefghi | 192s |
|
||||||
|
|
||||||
Scenario: Time of travel on combination of road types
|
Scenario: Time of travel on combination of road types
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b | c | d | e |
|
| a | b | c | d | e |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
@ -161,7 +161,7 @@ Feature: Estimation of travel time
|
|||||||
| a | e | abc,cde | 192s |
|
| a | e | abc,cde | 192s |
|
||||||
|
|
||||||
Scenario: Time of travel on part of a way
|
Scenario: Time of travel on part of a way
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | 1 |
|
| a | 1 |
|
||||||
| | 2 |
|
| | 2 |
|
||||||
| | 3 |
|
| | 3 |
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Feature: Basic Routing
|
Feature: Basic Routing
|
||||||
|
|
||||||
Scenario: Streetnames with UTF characters
|
Scenario: Streetnames with UTF characters
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | b | c | d |
|
| a | b | c | d |
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Feature: Choosing route based on length, speed, etc
|
Feature: Choosing route based on length, speed, etc
|
||||||
|
|
||||||
Scenario: Pick the geometrically shortest route, way types being equal
|
Scenario: Pick the geometrically shortest route, way types being equal
|
||||||
Given the nodes
|
Given the node map
|
||||||
| | s | |
|
| | s | |
|
||||||
| | t | |
|
| | t | |
|
||||||
| a | | b |
|
| a | | b |
|
||||||
@ -18,7 +18,7 @@ Feature: Choosing route based on length, speed, etc
|
|||||||
| a | b | atb |
|
| a | b | atb |
|
||||||
|
|
||||||
Scenario: Pick the fastest way type, lengths being equal
|
Scenario: Pick the fastest way type, lengths being equal
|
||||||
Given the nodes
|
Given the node map
|
||||||
| a | s |
|
| a | s |
|
||||||
| p | b |
|
| p | b |
|
||||||
|
|
||||||
|
@ -25,3 +25,4 @@
|
|||||||
ferry = 5
|
ferry = 5
|
||||||
|
|
||||||
excludeFromGrid = ferry
|
excludeFromGrid = ferry
|
||||||
|
trafficSignalPenalty = 10
|
Loading…
Reference in New Issue
Block a user