Skip to content

Make maxFlexTripDuration configurable - #4642

Merged
hannesj merged 4 commits into
opentripplanner:dev-2.xfrom
entur:otp2_remove_flex_params
Dec 6, 2022
Merged

Make maxFlexTripDuration configurable#4642
hannesj merged 4 commits into
opentripplanner:dev-2.xfrom
entur:otp2_remove_flex_params

Conversation

@hannesj

@hannesj hannesj commented Nov 28, 2022

Copy link
Copy Markdown
Contributor

Summary

Currently maxFlexTripDuration is hard-coded in the flex calculator. Make it configurable from the router config.

Also remove unnecessary FlexParameters, by just using FlexConfig where needed and migrate maxTransferDurationSeconds to duration-typed maxTransferDuration

@hannesj hannesj added !New Feature A functional feature targeting the end user. +Sandbox This will be implemented as a Sandbox feature labels Nov 28, 2022
@hannesj hannesj added this to the 2.3 milestone Nov 28, 2022
@hannesj
hannesj requested a review from a team as a code owner November 28, 2022 13:50

Duration maxTransferDuration;

if (json.exist("maxTransferDurationSeconds")) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm usually with Thomas here. People are just as likely to overlook the config change when you wait so you might as well make it backwards-incompatible now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will remove the compatibility

@leonardehrenfried leonardehrenfried added the +Config Change This PR might require the configuration to be updated. label Nov 28, 2022
Comment thread docs/RouterConfiguration.md Outdated
},
"flex" : {
"maxTransferDurationSeconds" : 240
"maxTransferDuration" : "30m"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is an unusually long example which can make performance quite bad.

Comment thread doc-templates/Flex.md
@hannesj hannesj added the Entur Test This is currently being tested at Entur label Nov 29, 2022
Also make maxFlexTripDuration configurable
@hannesj
hannesj force-pushed the otp2_remove_flex_params branch from 035526b to e21e576 Compare November 29, 2022 12:37
@hannesj
hannesj force-pushed the otp2_remove_flex_params branch from e21e576 to 3751a23 Compare November 29, 2022 12:38
@leonardehrenfried

Copy link
Copy Markdown
Member

Ah, I see the example config test is doing its job.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Base: 60.70% // Head: 60.71% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (76cef2c) compared to base (eb8cf1b).
Patch coverage: 97.72% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #4642   +/-   ##
==========================================
  Coverage      60.70%   60.71%           
+ Complexity     12240    12239    -1     
==========================================
  Files           1579     1579           
  Lines          63414    63431   +17     
  Branches        6990     6990           
==========================================
+ Hits           38498    38511   +13     
- Misses         22740    22743    +3     
- Partials        2176     2177    +1     
Impacted Files Coverage Δ
...pplanner/ext/flex/template/FlexEgressTemplate.java 64.70% <ø> (ø)
...va/org/opentripplanner/ext/flex/trip/FlexTrip.java 71.42% <ø> (ø)
...ipplanner/ext/flex/trip/ScheduledDeviatedTrip.java 57.42% <ø> (ø)
...opentripplanner/ext/flex/trip/UnscheduledTrip.java 49.49% <ø> (ø)
.../raptoradapter/router/street/DirectFlexRouter.java 95.83% <ø> (-0.17%) ⬇️
...radapter/router/street/FlexAccessEgressRouter.java 71.42% <ø> (-1.91%) ⬇️
...er/ext/flex/template/FlexAccessEgressTemplate.java 70.37% <83.33%> (+1.74%) ⬆️
.../java/org/opentripplanner/ext/flex/FlexRouter.java 92.59% <100.00%> (ø)
...x/flexpathcalculator/StreetFlexPathCalculator.java 96.55% <100.00%> (ø)
...pplanner/ext/flex/template/FlexAccessTemplate.java 65.21% <100.00%> (ø)
... and 5 more

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hannesj
hannesj merged commit c99b737 into opentripplanner:dev-2.x Dec 6, 2022
@hannesj
hannesj deleted the otp2_remove_flex_params branch December 6, 2022 14:11
t2gran pushed a commit that referenced this pull request Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

+Config Change This PR might require the configuration to be updated. Entur Test This is currently being tested at Entur !New Feature A functional feature targeting the end user. +Sandbox This will be implemented as a Sandbox feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants