commit
						11175748bb
					
				| @ -1,6 +1,7 @@ | |||||||
| @routing @penalty @signal | @routing @penalty @signal | ||||||
| Feature: Penalties | Feature: Penalties | ||||||
| 	 | Testbot uses a signal penalty of 7s | ||||||
|  | 
 | ||||||
| 	Background: | 	Background: | ||||||
| 		Given the speedprofile "testbot" | 		Given the speedprofile "testbot" | ||||||
| 			 | 			 | ||||||
| @ -21,7 +22,34 @@ Feature: Penalties | |||||||
| 		When I route I should get | 		When I route I should get | ||||||
| 		 | from | to | route | time    | | 		 | from | to | route | time    | | ||||||
| 		 | a    | c  | abc   | 20s +-1 | | 		 | a    | c  | abc   | 20s +-1 | | ||||||
| 		 | d    | f  | def   | 50s +-1 | | 		 | d    | f  | def   | 27s +-1 | | ||||||
|  | 
 | ||||||
|  | 	Scenario: Signal penalty should not depend on way type | ||||||
|  | 		Given the node map | ||||||
|  | 		 | a | b | c | | ||||||
|  | 		 | d | e | f | | ||||||
|  | 		 | g | h | i | | ||||||
|  | 
 | ||||||
|  | 		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 | ||||||
|  | 		 | from | to | route | time    | | ||||||
|  | 		 | a    | b  | abc   | 10s +-1 | | ||||||
|  | 		 | a    | c  | abc   | 17s +-1 | | ||||||
|  | 		 | d    | e  | def   | 20s +-1 | | ||||||
|  | 		 | d    | f  | def   | 27s +-1 | | ||||||
|  | 		 | g    | h  | ghi   | 30s +-1 | | ||||||
|  | 		 | g    | i  | ghi   | 37s +-1 | | ||||||
| 
 | 
 | ||||||
| 	Scenario: Passing multiple traffic signals should incur a accumulated delay | 	Scenario: Passing multiple traffic signals should incur a accumulated delay | ||||||
| 		Given the node map | 		Given the node map | ||||||
| @ -38,8 +66,8 @@ Feature: Penalties | |||||||
| 		 | abcde | | 		 | abcde | | ||||||
| 
 | 
 | ||||||
| 		When I route I should get | 		When I route I should get | ||||||
| 		 | from | to | route | time     | | 		 | from | to | route | time    | | ||||||
| 		 | a    | e  | abcde | 130s +-1 | | 		 | a    | e  | abcde | 61s +-1 | | ||||||
| 
 | 
 | ||||||
| 	Scenario: Starting or ending at a traffic signal should not incur a delay | 	Scenario: Starting or ending at a traffic signal should not incur a delay | ||||||
| 		Given the node map | 		Given the node map | ||||||
| @ -68,8 +96,8 @@ Feature: Penalties | |||||||
| 		 | d    | traffic_signals | | 		 | d    | traffic_signals | | ||||||
| 
 | 
 | ||||||
| 		And the ways | 		And the ways | ||||||
| 		 | nodes | | 		 | nodes | highway | | ||||||
| 		 | abcd   | | 		 | abcd  | primary | | ||||||
| 
 | 
 | ||||||
| 		When I route I should get | 		When I route I should get | ||||||
| 		 | from | to | route | time    | | 		 | from | to | route | time    | | ||||||
| @ -86,10 +114,10 @@ Feature: Penalties | |||||||
| 		 | b    | traffic_signals | | 		 | b    | traffic_signals | | ||||||
| 
 | 
 | ||||||
| 		And the ways | 		And the ways | ||||||
| 		 | nodes | | 		 | nodes | highway | | ||||||
| 		 | abc   | | 		 | abc   | primary | | ||||||
| 		 | adc   | | 		 | adc   | primary | | ||||||
|      |      | ||||||
| 		When I route I should get | 		When I route I should get | ||||||
| 		 | from | to | route |  | 		 | from | to | route |  | ||||||
| 		 | a    | c  | adc   | | 		 | a    | c  | adc   | | ||||||
| @ -13,6 +13,17 @@ speed_profile = { | |||||||
| 	["default"] = 24 | 	["default"] = 24 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | -- these settings are read directly by osrm | ||||||
|  | 
 | ||||||
|  | take_minimum_of_speeds 	= true | ||||||
|  | obey_oneway 			= true | ||||||
|  | obey_bollards 			= true | ||||||
|  | use_restrictions 		= true | ||||||
|  | ignore_areas 			= true	-- future feature | ||||||
|  | traffic_signal_penalty 	= 7		-- seconds | ||||||
|  | u_turn_penalty 			= 20 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| function node_function (node) | function node_function (node) | ||||||
| 	local traffic_signal = node.tags:Find("highway") | 	local traffic_signal = node.tags:Find("highway") | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user