Fix time penalty - #5715
Conversation
Raptor does not care about mode, so there is no difference between walking and driving; Hence having factory methods for CAR are very confusing. We have methods for walking and flex because they serve as "knob" for what to expect and a name to use in conversation. WALK => (simple, time-shiftable, fixed cost and duration) FLEX => (complex, opening-hours, hasRides, may arrive onBoard, multiple transfers)
… both forward and reverse search. Minor cleanup included.
This check for TIME_NOT_SET and add unit tests
… time-penalty before earliest-departure-time
…riteria comparison
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5715 +/- ##
=============================================
+ Coverage 67.69% 67.76% +0.07%
- Complexity 16369 16447 +78
=============================================
Files 1890 1900 +10
Lines 71812 72085 +273
Branches 7407 7425 +18
=============================================
+ Hits 48611 48849 +238
- Misses 20693 20727 +34
- Partials 2508 2509 +1 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
|
|
||
| /** | ||
| * There are 86400 seconds in a "normal" day(24 * 60 * 60). This is used for testing, logging | ||
| * and debugging, but does not base any important logic on this. A day with changes in |
There was a problem hiding this comment.
| * and debugging, but does not base any important logic on this. A day with changes in | |
| * and debugging, but don't base any important logic on this. A day with changes in |
There was a problem hiding this comment.
It is not recommended to use apostrophized (or in any way) shortened words in professional or formal english. The doc was appropriate while it was part of the main code, but I moved it into the test code to make it impossible to use in the main code. So, I do not think the doc is needed any more. I will clean it up.
leonardehrenfried
left a comment
There was a problem hiding this comment.
I must admit that I don't understand the RAPTOR part but the code looks good and I tested this with a few flex data sets and did not encounter the exception anymore.
|
It might be a good idea to run the speed tests on this PR. |
vpaturet
left a comment
There was a problem hiding this comment.
Only typos/clarifications
I tested also with Entur data, it works.
Co-authored-by: Vincent Paturet <46598384+vpaturet@users.noreply.github.com>
Co-authored-by: Vincent Paturet <46598384+vpaturet@users.noreply.github.com>
Summary
The time-penalty feature was implemented a bit too simple and did not work in a number of minor cases.
To make the time-penalty feature work poperly the feature is moved inside Raptor and is accounted for:
Issue
Closes #5681
Unit tests
✅ Unit tests are added for almost all new logic. In addition two module tests in Raptor is added to ensure that the access/egress is integrated into Raptor in the correct itteration and round. In addition this module tests test all Raptor profiles and forward/reverse search.
Documentation
JavaDoc is written and updated - no feature is changed, so none of the API/config doc is changed.
Changelog
✅ Should be included.
Bumping the serialization version id
✅ Unsure, but do it to be safe. There are chances to the Raptor API witch is stored in the config. Rarly configured, but better to be safe.