-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent bicycles from using stairs #4614
Prevent bicycles from using stairs #4614
Conversation
Codecov ReportBase: 60.63% // Head: 60.65% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #4614 +/- ##
=============================================
+ Coverage 60.63% 60.65% +0.02%
- Complexity 12229 12251 +22
=============================================
Files 1580 1580
Lines 63461 63491 +30
Branches 6994 6997 +3
=============================================
+ Hits 38481 38513 +32
Misses 22801 22801
+ Partials 2179 2177 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
At today's developer meeting we talked about it: we want to not totally ban bicycles on stairs but we want to give a very high default penalty so it's only used as a last resort. This cost is configurable so you can also exclude bikes on stairs. |
I discussed this with some people at HSL and they thought it might make sense to perhaps modify the cost based on https://wiki.openstreetmap.org/wiki/Key:ramp but would we then need two new parameters (bicycle walking on stairs with and without ramps)? I don't want to force you into doing this now but it's something we could consider and perhaps I (or someone else from Digitransit) could implement it at some point. Also, I wonder if the stairs reluctance is actually a client specific thing or something we should configure in the "safety" values as it would be more flexible in taking into account different tagging? However, the stairs also affect the traversal time so it's a bit more complicated. |
4cbafac
to
dd56873
Compare
At the moment it's not possible to assign a bike safety value to a set of stairs as bikes are not allowed on it: Line 62 in ad9f951
That doesn't mean that we cannot change it. Let's discuss it in the dev meeting. |
dd56873
to
01c929f
Compare
At today's meeting we discussed this. @hannesj and I were of the opinion that it's best to have a separate reluctance parameter, which I already added last week. @optionsome, if you disagree, lets discuss this in the issue. |
src/main/java/org/opentripplanner/routing/api/request/preference/BikePreferences.java
Outdated
Show resolved
Hide resolved
if (mode.isCycling() && isStairs()) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we set this already in the WayPropetySet, then we wouldn't need to check it during runtime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this can go away. The tag mapper already does that (
Line 62 in ad9f951
props.setProperties("highway=steps", pedestrianWayProperties); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
// very high reluctance to carry the bike up/down a flight of stairs | ||
this.stairsReluctance = 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you bike for 1h40m to avoid walking the stairs for 1 minute? I think 10 probably are better. We should try to use sensible values - if not, we undermine what "reluctance" mean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking more like: cycling 100 meters to avoid a one meter stairs. I would definitely take the long way.
Am I thinking about it the wrong way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually use time as a unit, if not it you must adjust when the speed changes. Generaflized-cost is equivalent of spending 1 second on a transit vehicle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a reason for this is that by default the time and cost of switching between walking and biking is 0, we should have some more reasonable defaults. That way the multiplier here can be more realistic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it with the original case in Kongsberg and even with a comparatively low reluctance of 10 the stairs are avoided. That is what we want.
Before
After
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I realised that I already do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or are you talking about the bike switch cost/time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think is correct, multiplying the weigh
is a reluctance. Strictly is a scalar, but the weight
in transit seconds
. See StreetEdge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a separate PR, where we change the default switch time & cost?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's a good idea.
023d832
to
b85ec40
Compare
b85ec40
to
542b4a5
Compare
b0d8c1a
to
542b4a5
Compare
We have a way to go here, but yes I think that would be nice. Some day we might use over own types instead of |
I realised that I already did use |
Summary
This hard-bans bicycles from using stairs even as a last resort.
Whether this is too strict or there are nuances we need to discuss in the developer meeting.
Issue
Fixes #4613
Unit tests
Added.
cc @tsobuskerudbyen