Search in sources :

Example 6 with PatternArriveVertex

use of org.opentripplanner.routing.vertextype.PatternArriveVertex in project OpenTripPlanner by opentripplanner.

the class Graph method index.

/**
 * Perform indexing on vertices, edges, and timetables, and create transient data structures.
 * This used to be done in readObject methods upon deserialization, but stand-alone mode now
 * allows passing graphs from graphbuilder to server in memory, without a round trip through
 * serialization.
 * TODO: do we really need a factory for different street vertex indexes?
 */
public void index(StreetVertexIndexFactory indexFactory) {
    streetIndex = indexFactory.newIndex(this);
    LOG.debug("street index built.");
    LOG.debug("Rebuilding edge and vertex indices.");
    rebuildVertexAndEdgeIndices();
    Set<TripPattern> tableTripPatterns = Sets.newHashSet();
    for (PatternArriveVertex pav : Iterables.filter(this.getVertices(), PatternArriveVertex.class)) {
        tableTripPatterns.add(pav.getTripPattern());
    }
    for (TripPattern ttp : tableTripPatterns) {
        // skip frequency-based patterns with no table (null)
        if (ttp != null)
            ttp.scheduledTimetable.finish();
    }
    // TODO: Move this ^ stuff into the graph index
    this.index = new GraphIndex(this);
}
Also used : PatternArriveVertex(org.opentripplanner.routing.vertextype.PatternArriveVertex) TripPattern(org.opentripplanner.routing.edgetype.TripPattern)

Aggregations

PatternArriveVertex (org.opentripplanner.routing.vertextype.PatternArriveVertex)6 Stop (org.onebusaway.gtfs.model.Stop)5 PatternHop (org.opentripplanner.routing.edgetype.PatternHop)5 TripPattern (org.opentripplanner.routing.edgetype.TripPattern)5 TripTimes (org.opentripplanner.routing.trippattern.TripTimes)5 Coordinate (com.vividsolutions.jts.geom.Coordinate)4 Agency (org.onebusaway.gtfs.model.Agency)4 AgencyAndId (org.onebusaway.gtfs.model.AgencyAndId)4 Route (org.onebusaway.gtfs.model.Route)4 StopTime (org.onebusaway.gtfs.model.StopTime)4 Trip (org.onebusaway.gtfs.model.Trip)4 StopPattern (org.opentripplanner.model.StopPattern)4 RoutingContext (org.opentripplanner.routing.core.RoutingContext)4 RoutingRequest (org.opentripplanner.routing.core.RoutingRequest)4 ServiceDay (org.opentripplanner.routing.core.ServiceDay)4 Graph (org.opentripplanner.routing.graph.Graph)4 Deduplicator (org.opentripplanner.routing.trippattern.Deduplicator)4 PatternDepartVertex (org.opentripplanner.routing.vertextype.PatternDepartVertex)4 TransitStop (org.opentripplanner.routing.vertextype.TransitStop)4 ArrayList (java.util.ArrayList)3