public class TripPattern extends Object implements Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
TransitBoardAlight[] |
alightEdges |
PatternArriveVertex[] |
arriveVertices |
TransitBoardAlight[] |
boardEdges |
String |
code
The short unique identifier for this trip pattern,
generally in the format Agency:RouteId:DirectionId:PatternNumber.
|
PatternDepartVertex[] |
departVertices |
int |
directionId
The direction id for all trips in this pattern.
|
PatternDwell[] |
dwellEdges |
static int |
FLAG_BIKES_ALLOWED |
static int |
FLAG_WHEELCHAIR_ACCESSIBLE |
org.locationtech.jts.geom.LineString |
geometry
Used by the MapBuilder (and should be exposed by the Index API).
|
PatternHop[] |
hopEdges |
static int |
MASK_DROPOFF |
static int |
MASK_PICKUP |
TraverseMode |
mode
The traverse mode for all trips in this pattern.
|
String |
name
The human-readable, unique name for this trip pattern.
|
static int |
NO_PICKUP |
Route |
route
The GTFS Route of all trips in this pattern.
|
Timetable |
scheduledTimetable
This is the "original" timetable holding the scheduled stop times from GTFS, with no
realtime updates applied.
|
static int |
SHIFT_DROPOFF |
static int |
SHIFT_PICKUP |
StopPattern |
stopPattern
All trips in this pattern call at this sequence of stops.
|
TransitStop[] |
stopVertices |
Constructor and Description |
---|
TripPattern(Route route,
StopPattern stopPattern) |
Modifier and Type | Method and Description |
---|---|
void |
add(FrequencyEntry freq)
Add the given FrequencyEntry to this pattern's scheduled timetable, recording the corresponding
trip as one of the scheduled trips on this pattern.
|
void |
add(TripTimes tt)
Add the given tripTimes to this pattern's scheduled timetable, recording the corresponding
trip as one of the scheduled trips on this pattern.
|
boolean |
canAlight(int stopIndex)
Returns whether passengers can alight at a given stop
|
boolean |
canBoard(int stopIndex)
Returns whether passengers can board at a given stop
|
TripPattern |
clone() |
void |
dumpServices() |
void |
dumpVertices() |
static void |
generateUniqueIds(Collection<TripPattern> tripPatterns)
Patterns do not have unique IDs in GTFS, so we make some by concatenating agency id, route id, the direction and
an integer.
|
static void |
generateUniqueNames(Collection<TripPattern> tableTripPatterns)
Static method that creates unique human-readable names for a collection of TableTripPatterns.
|
int |
getAlightType(int stopIndex) |
int |
getBoardType(int stopIndex) |
String |
getDirection() |
Trip |
getExemplar() |
String |
getFeedId()
Get the feed id this trip pattern belongs to.
|
int |
getNumScheduledTrips()
Gets the number of scheduled trips on this pattern.
|
List<PatternHop> |
getPatternHops() |
TripTimes |
getResolvedTripTimes(int tripIndex,
State state0) |
TripTimes |
getResolvedTripTimes(Trip trip,
State state0) |
BitSet |
getServices() |
FrequencyEntry |
getSingleFrequencyEntry()
This method can be used in very specific circumstances, where each TripPattern has only one FrequencyEntry.
|
Stop |
getStop(int stopIndex) |
List<Stop> |
getStops() |
Trip |
getTrip(int tripIndex) |
int |
getTripIndex(Trip trip) |
List<Trip> |
getTrips() |
Timetable |
getUpdatedTimetable(RoutingRequest req,
ServiceDay sd)
Rather than the scheduled timetable, get the one that has been updated with real-time updates.
|
String |
getZone(int stopIndex)
Returns the zone of a given stop
|
boolean |
hasFlexService() |
void |
makeGeometry()
Generates a geometry for the full pattern.
|
void |
makePatternVerticesAndEdges(Graph graph,
Map<Stop,? extends TransitStationStop> transitStops)
Create the PatternStop vertices and PatternBoard/Hop/Dwell/Alight edges corresponding to a
StopPattern/TripPattern.
|
String |
semanticHashString(Trip trip)
In most cases we want to use identity equality for Trips.
|
void |
setServiceCodes(Map<FeedScopedId,Integer> serviceCodes)
A bit of a strange place to set service codes all at once when TripTimes are already added,
but we need a reference to the Graph or at least the codes map.
|
void |
setServices(BitSet services) |
String |
toString() |
boolean |
wheelchairAccessible(int stopIndex)
Returns whether a given stop is wheelchair-accessible.
|
public static final int FLAG_WHEELCHAIR_ACCESSIBLE
public static final int MASK_PICKUP
public static final int SHIFT_PICKUP
public static final int MASK_DROPOFF
public static final int SHIFT_DROPOFF
public static final int NO_PICKUP
public static final int FLAG_BIKES_ALLOWED
public final Route route
public int directionId
public final TraverseMode mode
public final StopPattern stopPattern
public final Timetable scheduledTimetable
public String name
public String code
public final TransitStop[] stopVertices
public final PatternDepartVertex[] departVertices
public final PatternArriveVertex[] arriveVertices
public final TransitBoardAlight[] boardEdges
public final TransitBoardAlight[] alightEdges
public final PatternHop[] hopEdges
public final PatternDwell[] dwellEdges
public org.locationtech.jts.geom.LineString geometry
public TripPattern(Route route, StopPattern stopPattern)
public Stop getStop(int stopIndex)
public List<PatternHop> getPatternHops()
public Trip getTrip(int tripIndex)
public int getTripIndex(Trip trip)
public boolean canAlight(int stopIndex)
public boolean canBoard(int stopIndex)
public boolean wheelchairAccessible(int stopIndex)
public String getZone(int stopIndex)
public int getAlightType(int stopIndex)
public int getBoardType(int stopIndex)
public int getNumScheduledTrips()
public void add(TripTimes tt)
public void add(FrequencyEntry freq)
public Timetable getUpdatedTimetable(RoutingRequest req, ServiceDay sd)
public static void generateUniqueNames(Collection<TripPattern> tableTripPatterns)
public void makePatternVerticesAndEdges(Graph graph, Map<Stop,? extends TransitStationStop> transitStops)
graph
- graph to create vertices and edges intransitStops
- map of transit stops given the stop; it is assumed all stops of this trip
pattern are included in this map and refer to TransitStopspublic void dumpServices()
public void dumpVertices()
public void setServiceCodes(Map<FeedScopedId,Integer> serviceCodes)
public BitSet getServices()
public void setServices(BitSet services)
services
- bitset of service codespublic String getDirection()
public static void generateUniqueIds(Collection<TripPattern> tripPatterns)
public void makeGeometry()
public Trip getExemplar()
public String semanticHashString(Trip trip)
trip
- a trip object within this pattern, or null to hash the pattern itself independent any specific trip.public FrequencyEntry getSingleFrequencyEntry()
public TripPattern clone()
public String getFeedId()
public boolean hasFlexService()
Copyright © 2019. All rights reserved.