Skip to content

Commit a275257

Browse files
committed
Parameter simplification: allow maxWalkDistance = 0 to be specified and get rid of redundant excludeWalking parameter
1 parent 1feca7f commit a275257

File tree

4 files changed

+1
-19
lines changed

4 files changed

+1
-19
lines changed

src/main/java/org/opentripplanner/api/common/RoutingResource.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,6 @@ protected RoutingRequest buildRequest() throws ParameterException {
461461
if (maxWalkDistance != null) {
462462
request.setMaxWalkDistance(maxWalkDistance);
463463
request.maxTransferWalkDistance = maxWalkDistance;
464-
if (maxWalkDistance == 0.0) {
465-
request.excludeWalking = true;
466-
}
467464
}
468465

469466
if (maxPreTransitTime != null)

src/main/java/org/opentripplanner/routing/core/RoutingRequest.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,6 @@ public class RoutingRequest implements Cloneable, Serializable {
574574
*/
575575
public boolean enterStationsWithCar = false;
576576

577-
/**
578-
* Totally exclude walking from trip plan results. This should likely be false for the
579-
* majority of applications; however, when GTFS-Flex is enabled, customers may wish to avoid
580-
* walking at all costs (perhaps due to age or disability), which can be accomodated via call-
581-
* and-ride service.
582-
*/
583-
public boolean excludeWalking = false;
584-
585577
/**
586578
* Minimum length in meters of partial hop edges. This parameter only applies to GTFS-Flex
587579
* routing, which must be explicitly turned on via the useFlexService parameter in router-
@@ -1172,7 +1164,6 @@ public boolean equals(Object o) {
11721164
&& flexUseReservationServices == other.flexUseReservationServices
11731165
&& flexUseEligibilityServices == other.flexUseEligibilityServices
11741166
&& flexIgnoreDrtAdvanceBookMin == other.flexIgnoreDrtAdvanceBookMin
1175-
&& excludeWalking == other.excludeWalking
11761167
&& flexMinPartialHopLength == other.flexMinPartialHopLength
11771168
&& clockTimeSec == other.clockTimeSec;
11781169
}
@@ -1215,7 +1206,6 @@ public int hashCode() {
12151206
+ Boolean.hashCode(flexUseReservationServices) * 92429033
12161207
+ Boolean.hashCode(flexUseEligibilityServices) * 7916959
12171208
+ Boolean.hashCode(flexIgnoreDrtAdvanceBookMin) * 179992387
1218-
+ Boolean.hashCode(excludeWalking) * 989684221
12191209
+ Integer.hashCode(flexMinPartialHopLength) * 15485863
12201210
+ Long.hashCode(clockTimeSec) * 833389
12211211
+ new Boolean(disableRemainingWeightHeuristic).hashCode() * 193939;
@@ -1323,7 +1313,7 @@ private String getRouteOrAgencyStr(HashSet<String> strings) {
13231313
}
13241314

13251315
public void setMaxWalkDistance(double maxWalkDistance) {
1326-
if (maxWalkDistance > 0) {
1316+
if (maxWalkDistance >= 0) {
13271317
this.maxWalkDistance = maxWalkDistance;
13281318
bikeWalkingOptions.maxWalkDistance = maxWalkDistance;
13291319
}

src/main/java/org/opentripplanner/routing/edgetype/StreetEdge.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,6 @@ public double getDistance() {
243243
public State traverse(State s0) {
244244
final RoutingRequest options = s0.getOptions();
245245
final TraverseMode currMode = s0.getNonTransitMode();
246-
if (options.excludeWalking && currMode.equals(TraverseMode.WALK)) {
247-
return null;
248-
}
249246
StateEditor editor = doTraverse(s0, options, s0.getNonTransitMode());
250247
State state = (editor == null) ? null : editor.makeState();
251248
/* Kiss and ride support. Mode transitions occur without the explicit loop edges used in park-and-ride. */

src/main/java/org/opentripplanner/routing/flex/GtfsFlexGraphModifier.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ public void vertexVisitor(State state) {}
149149
*/
150150
public void createForwardHops(RoutingRequest request) {
151151
RoutingRequest forward = request.clone();
152-
forward.excludeWalking = false;
153152
forward.setMode(getMode());
154153
forward.setArriveBy(false);
155154
// allow discovery of stations even with car mode
@@ -164,7 +163,6 @@ public void createForwardHops(RoutingRequest request) {
164163
*/
165164
public void createBackwardHops(RoutingRequest request) {
166165
RoutingRequest backward = request.clone();
167-
backward.excludeWalking = false;
168166
backward.setMode(getMode());
169167
backward.setArriveBy(true);
170168
backward.enterStationsWithCar = true;

0 commit comments

Comments
 (0)