Open rsarathy opened 4 months ago
a highway-based penalty... will be p - 1, where p is the highway-based PenaltyCode's level.
How did you arrive at this formula? What sort of testing have you done to ensure this still gives reasonable routes elsewhere in SF, East Bay, etc?
We assign the p - 1
penalty in existing BikeCommonFlagEncoder code:
if (withTrafficCyclewayTags.contains(cyclewayForward))
cyclewayForwardPenalty = PenaltyCode.from(highwayPenalty).tickDownBy(1).getValue();
if (withTrafficCyclewayTags.contains(cyclewayBackward))
cyclewayBackwardPenalty = PenaltyCode.from(highwayPenalty).tickDownBy(1).getValue();
I'll play around with other bike-only routes to make sure this doesn't break things.
We assign the
p - 1
penalty
to be clear, the tickDownBy
function goes to the next lower penalty, whatever the value is. it doesn't subtract 1 from the penalty
Fixes #86:
A painted bike lane is still cycling infrastructure that is shared with car traffic. As such, ways that have
cycleway=lane
tags but also accommodate car traffic should receive a highway-based penalty.Adding
LANE
towithTrafficCyclewayTags
allows existingBikeCommonFlagEncoder
code to levy a highway-based penalty to the way. This penalty will bep - 1
, wherep
is the highway-basedPenaltyCode
's level.