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
+3 -2
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