-
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
Add default penalty to all car api modes #6302
base: dev-2.x
Are you sure you want to change the base?
Add default penalty to all car api modes #6302
Conversation
The CAR & CAR_PICKUP can be used in access/egress, but no penalty was set.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6302 +/- ##
=============================================
+ Coverage 69.71% 69.78% +0.07%
- Complexity 17696 17786 +90
=============================================
Files 2008 2017 +9
Lines 75834 76040 +206
Branches 7765 7783 +18
=============================================
+ Hits 52866 53065 +199
- Misses 20256 20267 +11
+ Partials 2712 2708 -4 ☔ View full report in Codecov by Sentry. |
Can you use CAR as an access or egress mode? I don't think so. |
According to the api qualified OpenTripPlanner/application/src/main/java/org/opentripplanner/routing/api/request/StreetMode.java Line 40 in 232eaec
|
You're right. I forgot about that one. |
var penaltyrBuilder = TimeAndCostPenaltyForEnum.of(StreetMode.class); | ||
|
||
var flexDefaultPenalty = TimeAndCostPenalty.of(TimePenalty.of(ofMinutes(10), 1.3f), 1.3); | ||
penaltyrBuilder.with(StreetMode.FLEXIBLE, flexDefaultPenalty); |
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.
penaltyrBuilder.with(StreetMode.FLEXIBLE, flexDefaultPenalty); | |
penaltyBuilder.with(StreetMode.FLEXIBLE, flexDefaultPenalty); |
"accessEgress: AccessEgressPreferences{penalty: TimeAndCostPenaltyForEnum{CAR_TO_PARK: " + | ||
"accessEgress: AccessEgressPreferences{penalty: TimeAndCostPenaltyForEnum{" + | ||
"CAR: (timePenalty: 20m + 2.0 t, costFactor: 1.50), " + | ||
"CAR_TO_PARK: " + | ||
CAR_PENALTY + |
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.
The name of this variable is a bit misleading since it's only used for CAR_TO_PARK
.
Summary
The CAR & CAR_PICKUP can be used in access/egress, but no default time-penalty was set.
We need to clearify if tipe-penalty should apply to CAR!
Issue
🟥 There is not issue for this. This is just a something we forgot to do. All CAR modes that can be used as access/egress should have a time-penalty, maybe except CAR.
Unit tests
✅ Unit tests are updated.
Documentation
✅ Unit tests are updated.
Changelog
✅ The bug exist in 2.6
Bumping the serialization version id
🟥 Not needed