-
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
Improve performance of speculative rental vehicle use in reverse search #6260
Improve performance of speculative rental vehicle use in reverse search #6260
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6260 +/- ##
=============================================
- Coverage 69.73% 69.71% -0.02%
- Complexity 17681 17701 +20
=============================================
Files 2007 2008 +1
Lines 75776 75844 +68
Branches 7755 7769 +14
=============================================
+ Hits 52845 52878 +33
- Misses 20218 20255 +37
+ Partials 2713 2711 -2 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
application/src/test/java/org/opentripplanner/street/model/edge/StreetEdgeGeofencingTest.java
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java
Outdated
Show resolved
Hide resolved
Can you fix the formatting? |
Yeah.. didn't even check, but of course the new parameter made the code too wide. Fixed now. |
application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java
Outdated
Show resolved
Hide resolved
application/src/test/java/org/opentripplanner/street/model/edge/StreetEdgeGeofencingTest.java
Show resolved
Hide resolved
…ZoneWhenReverseSearching
final State speculativeRenting = states[1]; | ||
final State speculativeRenting = states[2]; |
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.
Why did the order of states change btw?
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.
We only know if the unknown network case will be generated after generating the known cases. With recursive streams it was stuffed in the middle, but with an array it's easier (and more performant) to put it in the end. It shouldn't really matter what the order is, but in debugging it can be helpful that it is stable, so using State[] and not Set<State> is understandable.
Summary
Do not speculate use of rental networks which are not allowed by the request. They just cause extra states,
which in the end will not reach targets anyway.
Issue
The speculative fanout of extra rental network states can be massive in pathological cases, and serious
in accidental difficult cases.
Unit tests
The existing test StreetEdgeGeofencingTest did not find as many new states as it used to, and this
shows exactly what the fix is about. The expectation of the result was changed accordingly.
I can get better code coverage if this is not rejected outright.
Documentation
No documentation change, no high-level visible behavior state except execution speed.
Changelog
Could consider skip changelog.
Bumping the serialization version id
No.