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 |
com.vividsolutions.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 |
org.onebusaway.gtfs.model.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(org.onebusaway.gtfs.model.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() |
org.onebusaway.gtfs.model.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(org.onebusaway.gtfs.model.Trip trip,
State state0) |
BitSet |
getServices() |
FrequencyEntry |
getSingleFrequencyEntry()
This method can be used in very specific circumstances, where each TripPattern has only one FrequencyEntry.
|
org.onebusaway.gtfs.model.Stop |
getStop(int stopIndex) |
List<org.onebusaway.gtfs.model.Stop> |
getStops() |
org.onebusaway.gtfs.model.Trip |
getTrip(int tripIndex) |
int |
getTripIndex(org.onebusaway.gtfs.model.Trip trip) |
List<org.onebusaway.gtfs.model.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
|
void |
makeGeometry()
Generates a geometry for the full pattern.
|
void |
makePatternVerticesAndEdges(Graph graph,
Map<org.onebusaway.gtfs.model.Stop,? extends TransitStationStop> transitStops)
Create the PatternStop vertices and PatternBoard/Hop/Dwell/Alight edges corresponding to a
StopPattern/TripPattern.
|
String |
semanticHashString(org.onebusaway.gtfs.model.Trip trip)
In most cases we want to use identity equality for Trips.
|
void |
setServiceCodes(Map<org.onebusaway.gtfs.model.AgencyAndId,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 org.onebusaway.gtfs.model.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 com.vividsolutions.jts.geom.LineString geometry
public TripPattern(org.onebusaway.gtfs.model.Route route, StopPattern stopPattern)
public org.onebusaway.gtfs.model.Stop getStop(int stopIndex)
public List<org.onebusaway.gtfs.model.Stop> getStops()
public List<PatternHop> getPatternHops()
public org.onebusaway.gtfs.model.Trip getTrip(int tripIndex)
public List<org.onebusaway.gtfs.model.Trip> getTrips()
public int getTripIndex(org.onebusaway.gtfs.model.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 TripTimes getResolvedTripTimes(org.onebusaway.gtfs.model.Trip trip, State state0)
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<org.onebusaway.gtfs.model.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<org.onebusaway.gtfs.model.AgencyAndId,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 org.onebusaway.gtfs.model.Trip getExemplar()
public String semanticHashString(org.onebusaway.gtfs.model.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()
Copyright © 2018. All rights reserved.