Skip to content

Commit

Permalink
Revert "Update stopSequence to gtfsStopSequence"
Browse files Browse the repository at this point in the history
This reverts commit e950e50.
See discussion on PR #3527.
  • Loading branch information
abyrd committed Aug 5, 2021
1 parent b7d8d66 commit 8ee31d5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public TripTimes omitStops (TripTimes tt, int... stopsToSkip) {
cumulativeTime += dwellTime;
stopTime.setDepartureTime(cumulativeTime);

stopTime.setStopSequence(tt.getGtfsStopSequence(i));
stopTime.setStopSequence(tt.getStopSequence(i));
stopTime.setTimepoint(tt.isTimepoint(i) ? 1 : 0);
newSts.add(stopTime);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ private static Place makePlace(State state, Vertex vertex, Edge edge, Stop stop,
place.stopIndex = ((OnboardEdge) edge).getStopIndex();
if (endOfLeg) place.stopIndex++;
if (tripTimes != null) {
place.stopSequence = tripTimes.getGtfsStopSequence(place.stopIndex);
place.stopSequence = tripTimes.getStopSequence(place.stopIndex);
}
place.vertexType = VertexType.TRANSIT;
place.boardAlightType = BoardAlightType.DEFAULT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class TripTimeShort {
public int continuousDropOff;
public double serviceAreaRadius;
public String serviceArea;
public int gtfsStopSequence;
public int stopSequence;

/**
* This is stop-specific, so the index i is a stop index, not a hop index.
Expand All @@ -59,7 +59,7 @@ public TripTimeShort(TripTimes tt, int i, Stop stop) {
continuousDropOff = tt.getContinuousDropOff(i);
serviceAreaRadius = tt.getServiceAreaRadius(i);
serviceArea = tt.getServiceArea(i);
gtfsStopSequence = tt.getGtfsStopSequence(i);
stopSequence = tt.getStopSequence(i);
}

public TripTimeShort(TripTimes tt, int i, Stop stop, ServiceDay sd) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public TripTimes createUpdatedTripTimes(TripUpdate tripUpdate, TimeZone timeZone
boolean match = false;
if (update != null) {
if (update.hasStopSequence()) {
match = update.getStopSequence() == newTimes.getGtfsStopSequence(i);
match = update.getStopSequence() == newTimes.getStopSequence(i);
} else if (update.hasStopId()) {
match = pattern.getStop(i).getId().getId().equals(update.getStopId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class TripTimes implements Serializable, Comparable<TripTimes>, Cloneable
* trip level. An effort is made to re-use the sequence number arrays when they are the same
* across different trips in the same pattern.
*/
private final int[] gtfsStopSequences;
private final int[] stopSequences;

private final int[] continuousPickup;

Expand Down Expand Up @@ -184,7 +184,7 @@ public TripTimes(final Trip trip, final List<StopTime> stopTimes, final Deduplic
}
this.scheduledDepartureTimes = deduplicator.deduplicateIntArray(departures);
this.scheduledArrivalTimes = deduplicator.deduplicateIntArray(arrivals);
this.gtfsStopSequences = deduplicator.deduplicateIntArray(sequences);
this.stopSequences = deduplicator.deduplicateIntArray(sequences);
this.headsigns = deduplicator.deduplicateStringArray(makeHeadsignsArray(stopTimes));
// We set these to null to indicate that this is a non-updated/scheduled TripTimes.
// We cannot point to the scheduled times because they are shifted, and updated times are not.
Expand Down Expand Up @@ -215,7 +215,7 @@ public TripTimes(final TripTimes object) {
this.headsigns = object.headsigns;
this.scheduledDepartureTimes = object.scheduledDepartureTimes;
this.scheduledArrivalTimes = object.scheduledArrivalTimes;
this.gtfsStopSequences = object.gtfsStopSequences;
this.stopSequences = object.stopSequences;
this.timepoints = object.timepoints;
this.continuousPickup = object.continuousPickup;
this.continuousDropOff = object.continuousDropOff;
Expand Down Expand Up @@ -559,8 +559,8 @@ public TripTimes timeShift (final int stop, final int time, final boolean depart
}

/** Just to create uniform getter-syntax across the whole public interface of TripTimes. */
public int getGtfsStopSequence(final int stop) {
return gtfsStopSequences[stop];
public int getStopSequence(final int stop) {
return stopSequences[stop];
}

/** @return whether or not stopIndex is considered a timepoint in this TripTimes. */
Expand Down

0 comments on commit 8ee31d5

Please sign in to comment.