Skip to content

Commit

Permalink
Revert "NYS-168 second attempt at limited out-of-system transfers"
Browse files Browse the repository at this point in the history
This reverts commit 8c1e5c7
  • Loading branch information
mbsalvatore committed Dec 22, 2023
1 parent d4c9d32 commit 0e490b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 30 deletions.
11 changes: 5 additions & 6 deletions src/main/java/org/opentripplanner/routing/core/State.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package org.opentripplanner.routing.core;

import java.util.*;

import org.opentripplanner.model.Station;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Objects;
import java.util.Set;
import org.opentripplanner.routing.algorithm.astar.NegativeWeightException;
import org.opentripplanner.routing.api.request.RoutingRequest;
import org.opentripplanner.routing.edgetype.StreetEdge;
Expand Down Expand Up @@ -38,9 +40,6 @@ public class State implements Cloneable {
// we should DEFINITELY rename this variable and the associated methods.
public double walkDistance;

// keep track of transit stations entered to prevent out-of-system transfers
public List<Station> transitStationList = new ArrayList();

/* CONSTRUCTORS */

/**
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/org/opentripplanner/routing/core/StateEditor.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package org.opentripplanner.routing.core;

import org.opentripplanner.model.Station;
import org.opentripplanner.routing.graph.Edge;
import org.opentripplanner.routing.graph.Vertex;
import org.opentripplanner.routing.api.request.RoutingRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collections;
import java.util.Set;

/**
Expand Down Expand Up @@ -395,16 +393,4 @@ public void setBikeRentalNetwork(Set<String> networks) {
public State getBackState() {
return child.getBackState();
}

// record that station was entered
public void markTransitStation(Station station) {
if (station != null)
child.transitStationList.add(station);
}

// how many stations have been entered
public Set<Station> getTransitStationsEntered() {
return Set.copyOf(child.transitStationList);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,6 @@ else if (s0.isBikeRentingFromStation() && !(s0.mayKeepRentedBicycleAtDestination
int streetToStopTime = getStreetToStopTime();
s1.incrementTimeInSeconds(streetToStopTime);
s1.incrementWeight(STEL_TRAVERSE_COST + streetToStopTime);
if (this instanceof StreetTransitEntranceLink) {
// if we are entering transit mark it, but allow us to leave!
if (isLeavingStreetNetwork(req)) {
if (s1.getTransitStationsEntered().size() > 1) {
// ban this entrance, we've already taken an entrance
return null;
}
s1.markTransitStation(getTransitEntityVertex().getStationElement().getParentStation());
}
}
return s1.makeState();
}

Expand Down

0 comments on commit 0e490b5

Please sign in to comment.