Merge pull request #2707 from oxidase/left_side_driving

Left side driving
This commit is contained in:
Patrick Niklaus
2016-08-05 18:09:10 +02:00
committed by GitHub
14 changed files with 203 additions and 21 deletions
+2 -1
View File
@@ -138,13 +138,14 @@ properties.u_turn_penalty = 20
properties.traffic_signal_penalty = 2
properties.use_turn_restrictions = true
properties.continue_straight_at_waypoint = true
properties.left_hand_driving = false
local side_road_speed_multiplier = 0.8
local turn_penalty = 10
-- Note: this biases right-side driving. Should be
-- inverted for left-driving countries.
local turn_bias = 1.2
local turn_bias = properties.left_hand_driving and 1/1.2 or 1.2
local obey_oneway = true
local ignore_areas = true
+19
View File
@@ -0,0 +1,19 @@
-- Testbot, with turn penalty
-- Used for testing turn penalties
require 'testbot'
properties.left_hand_driving = true
local turn_penalty = 500
local turn_bias = properties.left_hand_driving and 1/1.2 or 1.2
function turn_function (angle)
---- compute turn penalty as angle^2, with a left/right bias
k = turn_penalty/(90.0*90.0)
if angle>=0 then
return angle*angle*k/turn_bias
else
return angle*angle*k*turn_bias
end
end
+19
View File
@@ -0,0 +1,19 @@
-- Testbot, with turn penalty
-- Used for testing turn penalties
require 'testbot'
properties.left_hand_driving = false
local turn_penalty = 500
local turn_bias = properties.left_hand_driving and 1/1.2 or 1.2
function turn_function (angle)
---- compute turn penalty as angle^2, with a left/right bias
k = turn_penalty/(90.0*90.0)
if angle>=0 then
return angle*angle*k/turn_bias
else
return angle*angle*k*turn_bias
end
end