State all turn penalties in seconds

This commit is contained in:
Patrick Niklaus 2016-08-19 13:51:53 +02:00 committed by Moritz Kobitzsch
parent cb57ccacef
commit 6ff07f4e82
5 changed files with 14 additions and 9 deletions

View File

@ -99,7 +99,7 @@ properties.continue_straight_at_waypoint = false
local obey_oneway = true
local ignore_areas = true
local turn_penalty = 60
local turn_penalty = 6
local turn_bias = 1.4
-- reduce the driving speed by 30% for unsafe roads
-- local safety_penalty = 0.7
@ -402,7 +402,8 @@ end
function turn_function (angle)
-- compute turn penalty as angle^2, with a left/right bias
k = turn_penalty/(90.0*90.0)
-- multiplying by 10 converts to deci-seconds see issue #1318
k = 10*turn_penalty/(90.0*90.0)
if angle>=0 then
return angle*angle*k/turn_bias
else

View File

@ -144,7 +144,7 @@ properties.left_hand_driving = false
local side_road_speed_multiplier = 0.8
local turn_penalty = 10
local turn_penalty = 1
-- Note: this biases right-side driving. Should be
-- inverted for left-driving countries.
local turn_bias = properties.left_hand_driving and 1/1.2 or 1.2
@ -526,7 +526,8 @@ end
function turn_function (angle)
---- compute turn penalty as angle^2, with a left/right bias
k = turn_penalty/(90.0*90.0)
-- multiplying by 10 converts to deci-seconds see issue #1318
k = 10*turn_penalty/(90.0*90.0)
if angle>=0 then
return angle*angle*k/turn_bias
else

View File

@ -5,12 +5,13 @@ require 'testbot'
properties.left_hand_driving = true
local turn_penalty = 500
local turn_penalty = 50
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)
-- multiplying by 10 converts to deci-seconds see issue #1318
k = 10*turn_penalty/(90.0*90.0)
if angle>=0 then
return angle*angle*k/turn_bias
else

View File

@ -5,12 +5,13 @@ require 'testbot'
properties.left_hand_driving = false
local turn_penalty = 500
local turn_penalty = 50
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)
-- multiplying by 10 converts to deci-seconds see issue #1318
k = 10*turn_penalty/(90.0*90.0)
if angle>=0 then
return angle*angle*k/turn_bias
else

View File

@ -4,5 +4,6 @@
require 'testbot'
function turn_function (angle)
return 200*math.abs(angle)/180 -- penalty
-- multiplying by 10 converts to deci-seconds see issue #1318
return 10*20*math.abs(angle)/180
end