State all turn penalties in seconds
This commit is contained in:
parent
cb57ccacef
commit
6ff07f4e82
@ -99,7 +99,7 @@ properties.continue_straight_at_waypoint = false
|
|||||||
|
|
||||||
local obey_oneway = true
|
local obey_oneway = true
|
||||||
local ignore_areas = true
|
local ignore_areas = true
|
||||||
local turn_penalty = 60
|
local turn_penalty = 6
|
||||||
local turn_bias = 1.4
|
local turn_bias = 1.4
|
||||||
-- reduce the driving speed by 30% for unsafe roads
|
-- reduce the driving speed by 30% for unsafe roads
|
||||||
-- local safety_penalty = 0.7
|
-- local safety_penalty = 0.7
|
||||||
@ -402,7 +402,8 @@ end
|
|||||||
|
|
||||||
function turn_function (angle)
|
function turn_function (angle)
|
||||||
-- compute turn penalty as angle^2, with a left/right bias
|
-- 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
|
if angle>=0 then
|
||||||
return angle*angle*k/turn_bias
|
return angle*angle*k/turn_bias
|
||||||
else
|
else
|
||||||
|
@ -144,7 +144,7 @@ properties.left_hand_driving = false
|
|||||||
|
|
||||||
local side_road_speed_multiplier = 0.8
|
local side_road_speed_multiplier = 0.8
|
||||||
|
|
||||||
local turn_penalty = 10
|
local turn_penalty = 1
|
||||||
-- Note: this biases right-side driving. Should be
|
-- Note: this biases right-side driving. Should be
|
||||||
-- inverted for left-driving countries.
|
-- inverted for left-driving countries.
|
||||||
local turn_bias = properties.left_hand_driving and 1/1.2 or 1.2
|
local turn_bias = properties.left_hand_driving and 1/1.2 or 1.2
|
||||||
@ -526,7 +526,8 @@ end
|
|||||||
|
|
||||||
function turn_function (angle)
|
function turn_function (angle)
|
||||||
---- compute turn penalty as angle^2, with a left/right bias
|
---- 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
|
if angle>=0 then
|
||||||
return angle*angle*k/turn_bias
|
return angle*angle*k/turn_bias
|
||||||
else
|
else
|
||||||
|
@ -5,12 +5,13 @@ require 'testbot'
|
|||||||
|
|
||||||
properties.left_hand_driving = true
|
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
|
local turn_bias = properties.left_hand_driving and 1/1.2 or 1.2
|
||||||
|
|
||||||
function turn_function (angle)
|
function turn_function (angle)
|
||||||
---- compute turn penalty as angle^2, with a left/right bias
|
---- 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
|
if angle>=0 then
|
||||||
return angle*angle*k/turn_bias
|
return angle*angle*k/turn_bias
|
||||||
else
|
else
|
||||||
|
@ -5,12 +5,13 @@ require 'testbot'
|
|||||||
|
|
||||||
properties.left_hand_driving = false
|
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
|
local turn_bias = properties.left_hand_driving and 1/1.2 or 1.2
|
||||||
|
|
||||||
function turn_function (angle)
|
function turn_function (angle)
|
||||||
---- compute turn penalty as angle^2, with a left/right bias
|
---- 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
|
if angle>=0 then
|
||||||
return angle*angle*k/turn_bias
|
return angle*angle*k/turn_bias
|
||||||
else
|
else
|
||||||
|
@ -4,5 +4,6 @@
|
|||||||
require 'testbot'
|
require 'testbot'
|
||||||
|
|
||||||
function turn_function (angle)
|
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
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user