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

Remove default accessegress penalty for car modes that use transit #6414

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

Conversation

VillePihlava
Copy link
Contributor

Summary

This PR removes the default accessegress penalty for car modes that use transit.

Issue

This is a follow-up PR related to issue #5875

Documentation

Automatically generated changes.

@VillePihlava VillePihlava requested a review from a team as a code owner January 30, 2025 12:08
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

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

Project coverage is 69.86%. Comparing base (fe5c570) to head (53eeb8a).
Report is 58 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...pi/request/preference/AccessEgressPreferences.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6414      +/-   ##
=============================================
+ Coverage      69.84%   69.86%   +0.02%     
+ Complexity     18124    18123       -1     
=============================================
  Files           2069     2069              
  Lines          77268    77240      -28     
  Branches        7855     7845      -10     
=============================================
- Hits           53965    53964       -1     
+ Misses         20546    20524      -22     
+ Partials        2757     2752       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -171,7 +171,9 @@ private static TimeAndCostPenaltyForEnum<StreetMode> createDefaultCarPenalty() {
// Add penalty to all car variants with access and/or egress.
Copy link
Member

Choose a reason for hiding this comment

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

This comment should be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to the comment Thomas wrote below

Copy link
Member

@t2gran t2gran left a comment

Choose a reason for hiding this comment

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

I searched for more information on this, but could not find any.

Comment on lines 174 to 176
if (
it.includesDriving() && (it.accessAllowed() || it.egressAllowed()) && !it.transferAllowed()
) {
Copy link
Member

@t2gran t2gran Jan 30, 2025

Choose a reason for hiding this comment

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

Suggested change
if (
it.includesDriving() && (it.accessAllowed() || it.egressAllowed()) && !it.transferAllowed()
) {
// Apply car-penalty to all car modes allowed in access/egress only. Exclude car modes(CAR) used
// in direct street routing and car modes used when you bring the car with you onto transit. This is
// a bit limited and will not work if we combine car access/egress modes like CAR_TO_PARK with CAR
// in the same search. This is currently not possible, but if we enable this in the future this logic must be
// looked at again.
if (
it.includesDriving() && (it.accessAllowed() || it.egressAllowed()) && it != CAR
) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it to this and removed the existing comment

@t2gran
Copy link
Member

t2gran commented Jan 30, 2025

I tried, but did not find any issue discussing the issues around penalty on CAR and other street modes.

@leonardehrenfried
Copy link
Member

We discussed it (very lightly) in the original PR: #6302

@t2gran
Copy link
Member

t2gran commented Jan 30, 2025

Yes I fount it, but I was almost sure there was a issue with a more in dept discussion. The PR was not very helpful, but good to reference it anyway.

Comment on lines 173 to 174
// Apply car-penalty to all car modes allowed in access/egress only. Exclude car modes(CAR) used
// in direct street routing and car modes used when you bring the car with you onto transit. This is
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure CAR_TO_PARK and CAR_RENTAL are at least allowed in direct routing and I think they are not excluded now.

Copy link
Member

@t2gran t2gran Feb 4, 2025

Choose a reason for hiding this comment

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

I made a suggestion for the comment. Most of the itinerary filters work fine with this, but comparing transit and direct is not ideal. We do take away the penalty (both time and cost) in these cases, so the comparison is ok - but it is very difficult to understand just lokking at the results/tuning the filters.

The main thing is that MODES used together with transit in the same journey should have a penalty. I do not think the penalty is applied to direct searches, so it might not hurt to have it specified for direct modes, but I think it is confusing if we do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the comment to the suggestion by @t2gran

Comment on lines 173 to 177
// Apply car-penalty to all car modes allowed in access/egress only. Exclude car modes(CAR) used
// in direct street routing and car modes used when you bring the car with you onto transit. This is
// a bit limited and will not work if we combine car access/egress modes like CAR_TO_PARK with CAR
// in the same search. This is currently not possible, but if we enable this in the future this logic must be
// looked at again.
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
// Apply car-penalty to all car modes allowed in access/egress only. Exclude car modes(CAR) used
// in direct street routing and car modes used when you bring the car with you onto transit. This is
// a bit limited and will not work if we combine car access/egress modes like CAR_TO_PARK with CAR
// in the same search. This is currently not possible, but if we enable this in the future this logic must be
// looked at again.
// Apply car-penalty to all car modes used in access/egress. Car modes(CAR) used in direct street
// routing and car modes used when you bring the car with you onto transit should be excluded. The
// penalty should also be applied to modes used in access, egress AND direct (CAR_TO_PARK and
// CAR_RENTAL). This is not ideal, since we get an unfair comparison in the itinerary filters. We will
// live with this for now, but might revisit it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the comment to this

@t2gran t2gran added this to the 2.7 (next release) milestone Feb 4, 2025
@t2gran t2gran added the Improvement A functional improvement label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement A functional improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants