Take stop signs into account during routing

This commit is contained in:
Siarhei Fedartsou
2022-10-28 22:30:50 +02:00
parent 3558ec9db4
commit 4432756de1
4 changed files with 22 additions and 24 deletions
+2 -2
View File
@@ -30,6 +30,7 @@ function setup()
use_turn_restrictions = true,
left_hand_driving = false,
traffic_light_penalty = 2,
stop_sign_penalty = 2
},
default_mode = mode.driving,
@@ -481,8 +482,7 @@ function process_turn(profile, turn)
if turn.has_traffic_light then
turn.duration = profile.properties.traffic_light_penalty
elseif turn.has_stop_sign then
-- TODO: use another constant
turn.duration = profile.properties.traffic_light_penalty
turn.duration = profile.properties.stop_sign_penalty
end
+2 -2
View File
@@ -9,10 +9,10 @@ function TrafficSignal.get_value(node)
local direction = node:get_value_by_key("traffic_signals:direction")
if direction then
if "forward" == direction then
return traffic_lights.direction_forward
return traffic_flow_control_direction.direction_forward
end
if "backward" == direction then
return traffic_lights.direction_reverse
return traffic_flow_control_direction.direction_reverse
end
end
-- return traffic_lights.direction_all