Skip to content

Fix bug in optimize transfer service decorating path#3587

Merged
t2gran merged 4 commits into
opentripplanner:dev-2.xfrom
entur:otp2_fix_bug_optimized_transfer
Aug 19, 2021
Merged

Fix bug in optimize transfer service decorating path#3587
t2gran merged 4 commits into
opentripplanner:dev-2.xfrom
entur:otp2_fix_bug_optimized_transfer

Conversation

@t2gran

@t2gran t2gran commented Aug 18, 2021

Copy link
Copy Markdown
Member

Summary

When Raptor return a path with a transfer at another stop then the optimal stop to transfer, then optimized transfer service will find the correct stop/path, but the transfer information is not attached to the new path in a correct way. The OptimizedPath map of transfers(transfersTo) are updated with the correct transfer, but the key used is the old leg, not the new. This causes the lookup to fail later.

Issue

No issue is created for this "small" bugfix.

Unit tests

The second commit add extensive unit-tests for this case. It also improve the tests on TransferPriority, witch was not properly tested. The tests are "semi" high level. They test the OptimizePathService, low level tests already exist.

Documentation

Only JavaDoc is updated.

Changelog

Changelog.md is updated.

When Raptor return a path with a transfer at another stop than the
optimal stop to transfer, then optimized transfer service will find the
correct stop/path, but the transfer information is not attached to the
new path in a correct way. The OptimizedPath map of transfers(transfersTo)
are updated with the correct transfer, but the key used is the old leg,
not the new. This causes the lookup to fail later.
@t2gran t2gran added !Bug Apply to issues describing a bug and PRs witch fixes it. Entur Test This is currently being tested at Entur labels Aug 18, 2021
@t2gran t2gran added this to the 2.1 milestone Aug 18, 2021
@t2gran t2gran marked this pull request as ready for review August 18, 2021 15:05
@t2gran t2gran requested a review from a team as a code owner August 18, 2021 15:05
t2gran added 2 commits August 18, 2021 17:07
Add unit tests to verify the fix is correct and to prevent it from
happening again.
@t2gran t2gran force-pushed the otp2_fix_bug_optimized_transfer branch from 82f44b7 to 1a7545b Compare August 18, 2021 15:08
Comment on lines +26 to +27
* Trip 1 10:02 10:10 10:15 10:20 10:25 10:30
* Trip 2 10:13 10:18 10:24 10:30 10:36 10:40

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.

Discussed diffrent formatting: 10:10 (A) 10:13 (B) eliminating Stop row.


/**
* <pre>
* DEPARTURE TIMES

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.

Each column represents one possible transfer.

@t2gran t2gran merged commit 8c88138 into opentripplanner:dev-2.x Aug 19, 2021
@t2gran t2gran deleted the otp2_fix_bug_optimized_transfer branch August 19, 2021 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it. Entur Test This is currently being tested at Entur

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants