-
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 'transfers' build config field #6215
base: dev-2.x
Are you sure you want to change the base?
Add 'transfers' build config field #6215
Conversation
…th the 'carsAllowedStopMaxTransferDurationsForMode' build config parameter.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6215 +/- ##
=============================================
+ Coverage 69.85% 69.86% +0.01%
- Complexity 17917 17939 +22
=============================================
Files 2035 2038 +3
Lines 76497 76609 +112
Branches 7822 7834 +12
=============================================
+ Hits 53436 53524 +88
- Misses 20325 20347 +22
- Partials 2736 2738 +2 ☔ View full report in Codecov by Sentry. |
There are some conflicts |
…into car-transferrequest-filtering
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've had too many reviews today already so I didn't go properly through this. However, inspired by some concerns from @t2gran, I think to avoid issues we should do a couple of things:
- Introduce
carsAllowedStopMaxAccessEgressDurationsForMode
. This is to prevent weird back-and-forth transfers to avoid access and egress duration limitations. - Prevent these transfers from being used by other street modes. I don't know if this is already done or not but I think at least previously all the transfers were in the same collection. This could again lead to weird back and forth travel by walking for example to escape some other restrictions.
mBuilder.withEgressMode(StreetMode.WALK); | ||
mBuilder.withDirectMode(StreetMode.CAR); | ||
// This is used in transfer cache request calculations. | ||
mBuilder.withAllStreetModes(StreetMode.CAR); |
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 know this builder method wasn't introduced in this pr but this name is really confusing. Idk what we call Access+Transfer+Egress+Direct. It's difficult to come up with a name that doesn't confuse you into thinking that all modes are enabled. Just making this singular would maybe make it less confusing.
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 changed it to set each mode separately for more clarity
@@ -60,6 +68,23 @@ public DirectTransferGenerator( | |||
this.issueStore = issueStore; | |||
this.radiusByDuration = radiusByDuration; | |||
this.transferRequests = transferRequests; | |||
this.carsAllowedStopMaxTransferDurationsForMode = DurationForEnum.of(StreetMode.class).build(); |
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.
Maybe we should always include this with some default value that is the same as the normal transfer duration limit.
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.
This has changed quite a lot, but you can look at how I handle an empty parameter
.stream() | ||
.map(StopLocation::getId) | ||
.map(graph::getStopVertexForStopId) | ||
.filter(TransitStopVertex.class::isInstance) // filter out null values if no TransitStopVertex is found for ID |
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.
Inline comments are not allowed.
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.
Removed
I'm changing this to a draft for now. I'll return to this once the work on the separate transfer request collections for modes has been completed. |
…into car-transferrequest-filtering
Summary
This PR adds the
transfers
build config field for configuring transfers. These parameters can be configured for all transfer modes:disableDefaultTransfers
: allows disabling default transfer calculationsmaxTransferDuration
: allows configuring a mode-specificmaxTransferDuration
carsAllowedStopMaxTransferDuration
: allows changing max transfer durations between stops that allow carsThis is a follow-up PR related to #5966. Example configuration:
Issue
This is a follow-up PR related to issue #5875.
Unit tests
I created new unit tests for testing the changes to the
DirectTransferGenerator
Documentation
Changes to
BuildConfiguration.md
Bumping the serialization version id
This change affects how transfers are calculated and adds a new field to the
build-config.json
file.