Skip to content
Snippets Groups Projects
Commit a65651ea authored by Winfried Stenzel's avatar Winfried Stenzel
Browse files

reduce downhill penalties; prefer mtb:scale=0-|0|0+|1-|1|1+|2-|2 and...

reduce downhill penalties; prefer mtb:scale=0-|0|0+|1-|1|1+|2-|2 and sac_scale=mountain_hiking (differently without changing mtb_sac_scale, because it should stay zero by default)
parent 85234ddf
No related branches found
No related tags found
No related merge requests found
......@@ -65,9 +65,9 @@ assign isfoot_reduce = 0.9 # penalty reduction for major
# +++ special downhill parameters
assign considerdownhill = true # use special penalties for downhills? (enables/disables below parameters)
assign dh_penalty = max 0 ( add 2.0 ( multiply mtb_hard_factor 0.5 ) )
assign dh_penalty = max 0 ( add 1 ( multiply mtb_hard_factor 0.5 ) )
# additional penalty for undesired downhills (e.g. major roads)
assign dh_difficult_penalty = max 0 ( sub 10 ( multiply mtb_hard_factor 1 ) )
assign dh_difficult_penalty = max 0 ( sub 1 ( multiply mtb_hard_factor 1 ) )
# additional downhill penalty for ways with high difficulty (mtb/sac_scale)
assign dh_use_tracks = lesser mtb_hard_factor 0
# use less penalty for downhill tracks than for other waytypes? (0/1)
......@@ -227,14 +227,16 @@ assign mtb_sac_penalty =
multiply
( sub 1 ( multiply mtb_hard_factor 0.25 ) )
(
if ( or mtb:scale=0-|0|0+|1-|1|1+|2-|2 sac_scale=mountain_hiking ) then 0
else if ( or mtb:scale=3|2+ sac_scale=demanding_mountain_hiking ) then 2
if ( or mtb:scale=3|2+ sac_scale=demanding_mountain_hiking ) then 2
else if ( or mtb:scale=4 sac_scale=alpine_hiking ) then 4
else if ( or mtb:scale=5 sac_scale=demanding_alpine_hiking ) then 50
else if ( or mtb:scale=6 sac_scale=difficult_alpine_hiking ) then 100
else 0.5
else 0
)
assign no_mtb_sac_penalty if ( and mtb:scale= sac_scale= ) then 0.5
else 0
assign mtb_uh_penalty = #(supported since 1.4.4)
max 0
multiply
......@@ -493,6 +495,7 @@ assign costfactor =
)
)
else mtb_sac_penalty
add no_mtb_sac_penalty
add tracktype_penalty
max 1
if hw_penalty then hw_penalty
......@@ -536,7 +539,8 @@ assign uphillcostfactor =
if mtb_sac_penalty then add uh_difficult_penalty mtb_sac_penalty
else 0
)
add if tracktype_penalty then add uh_difficult_penalty tracktype_penalty
add no_mtb_sac_penalty
add if tracktype_penalty then add uh_difficult_penalty tracktype_penalty
else 0
max 1
if hw_penalty then hw_penalty
......@@ -578,6 +582,7 @@ assign downhillcostfactor =
if mtb_sac_penalty then add dh_difficult_penalty mtb_sac_penalty
else 0
)
add no_mtb_sac_penalty
add if tracktype_penalty then add dh_difficult_penalty tracktype_penalty
else 0
max 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment