22
22
import java .util .stream .StreamSupport ;
23
23
24
24
/**
25
+ * All the Trips on the same Route that have the same sequence of stops, with the same pickup/dropoff options.
25
26
* This is like a Transmodel JourneyPattern.
26
- * All the trips on the same Route that have the same sequence of stops, with the same pickup/dropoff options.
27
27
*/
28
28
public class TripPattern implements Serializable , Cloneable {
29
29
@@ -33,6 +33,7 @@ public class TripPattern implements Serializable, Cloneable {
33
33
* This is the ID of this trip pattern _in the original transport network_. This is important because if it were the
34
34
* ID in this transport network the ID would depend on the order of application of scenarios, and because this ID is
35
35
* used to map results back to the original network.
36
+ * TODO This concept of an "original" transport network may be obsolete, this field doesn't seem to be used anywhere.
36
37
*/
37
38
public int originalId ;
38
39
@@ -44,8 +45,7 @@ public class TripPattern implements Serializable, Cloneable {
44
45
public PickDropType [] dropoffs ;
45
46
public BitSet wheelchairAccessible ; // One bit per stop
46
47
47
- /** TripSchedules for all trips following this pattern, sorted in ascending order by time of departure from first
48
- * stop */
48
+ /** TripSchedules for all trips in this pattern, sorted in ascending order by time of departure from first stop. */
49
49
public List <TripSchedule > tripSchedules = new ArrayList <>();
50
50
51
51
/** GTFS shape for this pattern. Should be left null in non-customer-facing applications */
@@ -67,8 +67,8 @@ public class TripPattern implements Serializable, Cloneable {
67
67
public BitSet servicesActive = new BitSet ();
68
68
69
69
/**
70
- * index of this route in TransitLayer data. -1 if detailed route information has not been loaded
71
- * TODO clarify what " this route" means. The route of this tripPattern ?
70
+ * The index of this TripPatterns's route in the TransitLayer, or -1 if not yet loaded.
71
+ * Do we really want/need this redundant representation of routeId ?
72
72
*/
73
73
public int routeIndex = -1 ;
74
74
@@ -132,6 +132,8 @@ public void setOrVerifyDirection (int directionId) {
132
132
/**
133
133
* Linear search.
134
134
* @return null if no departure is possible.
135
+ * FIXME this is unused. And is active true by definition (this.servicesActive is a BitSet with serviceCode set for
136
+ * every one of this.tripSchedules)?
135
137
*/
136
138
TripSchedule findNextDeparture (int time , int stopOffset ) {
137
139
TripSchedule bestSchedule = null ;
@@ -177,9 +179,7 @@ public String toStringDetailed (TransitLayer transitLayer) {
177
179
return sb .toString ();
178
180
}
179
181
180
- /**
181
- * @return true when none of the supplied tripIds are on this pattern.
182
- */
182
+ /** @return true when none of the supplied tripIds are on this pattern. */
183
183
public boolean containsNoTrips (Set <String > tripIds ) {
184
184
return this .tripSchedules .stream ().noneMatch (ts -> tripIds .contains (ts .tripId ));
185
185
}
@@ -225,5 +225,4 @@ public List<LineString> getHopGeometries(TransitLayer transitLayer) {
225
225
}
226
226
return geometries ;
227
227
}
228
-
229
228
}
0 commit comments