Skip to content
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

ReverseSearch field is now on StreetRouter #296

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

buma
Copy link
Contributor

@buma buma commented Jul 5, 2017

Instead of ProfileRequest

Since I wasn't able to make tests for change. I tested with comparing two saved requests.
Times, distances and paths are the same also for Bike rental and P+R.

Copy link
Member

@abyrd abyrd left a comment

Choose a reason for hiding this comment

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

Revisiting this in October 2020, we're no longer using point to point routing much and I'm trying to understand what exactly this change does. It seems like this is making forward and backward searches a property of an individual street search, rather than something that is set across an entire request. This would facilitate doing several searches in different directions within a single request.

StreetRouter.State state = streetRouter.getStateAtVertex(startVertexStopIndex);
if (state != null) {
StreetPath streetPath;
if ((accessMode == LegMode.CAR_PARK || accessMode == LegMode.BICYCLE_RENT) && streetRouter.previousRouter != null) {
streetPath = new StreetPath(state, streetRouter, accessMode,
transportNetwork);
} else {
streetPath = new StreetPath(state, transportNetwork, false);
streetPath = new StreetPath(state, transportNetwork, streetRouter.reverseSearch); //reverse search is false
Copy link
Member

Choose a reason for hiding this comment

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

Here and on new L125 it's not clear to me why we're replacing hard-coded booleans with variables, accompanied with comments that state the values of those variables are constants.

for (Map.Entry<Integer, List<Transfer>> entry: transfersWithSameStart.entrySet()) {
StreetRouter streetRouter = new StreetRouter(transportNetwork.streetLayer);
//reverse search is false
Copy link
Member

Choose a reason for hiding this comment

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

Again here upon first reading I don't understand the comments asserting that certain values are true or false.

@abyrd abyrd closed this Apr 9, 2021
@abyrd abyrd deleted the branch dev April 9, 2021 04:50
@abyrd abyrd reopened this Apr 9, 2021
@abyrd abyrd changed the base branch from remove-cruft to dev April 9, 2021 05:24
@abyrd
Copy link
Member

abyrd commented Apr 9, 2021

Accidentally closed when cleaning up branches. I would like to revisit these old pull requests and determine whether they're still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants