Skip to content

Commit

Permalink
feat(access): Limit access time for walking
Browse files Browse the repository at this point in the history
  • Loading branch information
ansoncfit committed Nov 14, 2018
1 parent 27d2539 commit 38d2ac6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/com/conveyal/r5/analyst/TravelTimeComputer.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ public OneOriginResult computeTravelTimes() throws IOException {
nonTransitTravelTimesToDestinations = new int[accessModeLinkedDestinations.size()];
Arrays.fill(nonTransitTravelTimesToDestinations, FastRaptorWorker.UNREACHED);
} else if (accessMode == StreetMode.WALK) {
// Special handling for walk search, find distance in seconds and divide to match behavior at egress
// (in stop trees). For bike/car searches this is immaterial as the access searches are already asymmetric.
// Special handling for walk search: find distance in millimeters and divide by speed to match behavior
// at egress (in stop trees). For bike/car searches this is immaterial as the access searches are
// already asymmetric.
// TODO clarify - I think this is referring to the fact that the egress trees are pre-calculated for a standard speed and must be adjusted.
sr.distanceLimitMeters = 2000; // TODO hardwired same as gridcomputer, at least use a symbolic constant
sr.distanceLimitMeters = (int) (request.getSpeedForMode(accessMode) *
request.getMaxAccessTimeForMode(accessMode) * 60);
sr.quantityToMinimize = StreetRouter.State.RoutingVariable.DISTANCE_MILLIMETERS;
sr.route();

Expand Down

0 comments on commit 38d2ac6

Please sign in to comment.