Skip to content
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

Open
wants to merge 1 commit into
base: dev-2.x
Choose a base branch
from

Conversation

t2gran
Copy link
Member

@t2gran t2gran commented Dec 4, 2024

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

The CAR & CAR_PICKUP can be used in access/egress, but no penalty was set.
@t2gran t2gran added Bug Entur Test This is currently being tested at Entur labels Dec 4, 2024
@t2gran t2gran added this to the 2.7 (next release) milestone Dec 4, 2024
@t2gran t2gran requested a review from a team as a code owner December 4, 2024 10:13
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 69.78%. Comparing base (5b5d92f) to head (a682d98).
Report is 171 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...pi/request/preference/AccessEgressPreferences.java 88.88% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

@leonardehrenfried
Copy link
Member

leonardehrenfried commented Dec 6, 2024

Can you use CAR as an access or egress mode? I don't think so.

@t2gran
Copy link
Member Author

t2gran commented Dec 9, 2024

Can you use CAR as an access or egress mode? I don't think so.

According to the api qualified StreetMode you can. I expect to see car as mode for ferry search?

CAR(Feature.ACCESS, Feature.TRANSFER, Feature.EGRESS, Feature.DRIVING),

@leonardehrenfried
Copy link
Member

You're right. I forgot about that one.

@optionsome optionsome self-requested a review December 12, 2024 14:52
@leonardehrenfried leonardehrenfried changed the title Add default penalty to all car api modes. Add default penalty to all car api modes Dec 12, 2024
@leonardehrenfried leonardehrenfried self-requested a review December 12, 2024 14:55
var penaltyrBuilder = TimeAndCostPenaltyForEnum.of(StreetMode.class);

var flexDefaultPenalty = TimeAndCostPenalty.of(TimePenalty.of(ofMinutes(10), 1.3f), 1.3);
penaltyrBuilder.with(StreetMode.FLEXIBLE, flexDefaultPenalty);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 +
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Entur Test This is currently being tested at Entur
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants