-
Notifications
You must be signed in to change notification settings - Fork 75
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
buma
wants to merge
1
commit into
dev
Choose a base branch
from
addReverseFieldToStreetRouter
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,16 +93,14 @@ public void addTransitPath(Map<LegMode, StreetRouter> accessRouter, | |
if (accessPathIndex < 0) { | ||
//Here accessRouter needs to have this access mode since stopModeAccessMap is filled from accessRouter | ||
StreetRouter streetRouter = accessRouter.get(accessMode); | ||
//FIXME: Must we really update this on every streetrouter? | ||
streetRouter.profileRequest.reverseSearch = false; | ||
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 | ||
} | ||
StreetSegment streetSegment = new StreetSegment(streetPath, accessMode, transportNetwork.streetLayer); | ||
profileOption.addAccess(streetSegment, accessMode, startVertexStopIndex); | ||
|
@@ -122,11 +120,9 @@ public void addTransitPath(Map<LegMode, StreetRouter> accessRouter, | |
if (egressPathIndex < 0) { | ||
//Here egressRouter needs to have this egress mode since stopModeEgressMap is filled from egressRouter | ||
StreetRouter streetRouter = egressRouter.get(egressMode); | ||
//FIXME: Must we really update this on every streetrouter? | ||
streetRouter.profileRequest.reverseSearch = true; | ||
StreetRouter.State state = streetRouter.getStateAtVertex(endVertexStopIndex); | ||
if (state != null) { | ||
StreetPath streetPath = new StreetPath(state, transportNetwork, true); | ||
StreetPath streetPath = new StreetPath(state, transportNetwork, streetRouter.reverseSearch); // reverse search is true | ||
StreetSegment streetSegment = new StreetSegment(streetPath, egressMode, transportNetwork.streetLayer); | ||
profileOption.addEgress(streetSegment, egressMode, endVertexStopIndex); | ||
//This should never happen since stopModeEgressMap is filled from reached stops in egressRouter | ||
|
@@ -180,10 +176,9 @@ public void generateStreetTransfers(TransportNetwork transportNetwork, ProfileRe | |
Map<Integer, List<Transfer>> transfersWithSameStart = transferToOption.keySet().stream() | ||
.collect(Collectors.groupingBy(Transfer::getAlightStop)); | ||
//LOG.info("Filling middle paths"); | ||
boolean prevReverseSearch = request.reverseSearch; | ||
request.reverseSearch = false; | ||
for (Map.Entry<Integer, List<Transfer>> entry: transfersWithSameStart.entrySet()) { | ||
StreetRouter streetRouter = new StreetRouter(transportNetwork.streetLayer); | ||
//reverse search is false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
streetRouter.streetMode = StreetMode.WALK; | ||
streetRouter.profileRequest = request; | ||
//TODO: make configurable distanceLimitMeters in middle | ||
|
@@ -207,7 +202,6 @@ public void generateStreetTransfers(TransportNetwork transportNetwork, ProfileRe | |
} | ||
} | ||
} | ||
request.reverseSearch = prevReverseSearch; | ||
} | ||
|
||
/** Recompute stats for all options, should be done once all options have been added */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.