Package org.opentripplanner.routing.algorithm

Examples of org.opentripplanner.routing.algorithm.EarliestArrivalSPTService


          else
            graph = server.graphService.getGraph(routerId);
           
          req.setRoutingContext(graph);
         
            EarliestArrivalSPTService sptService = new EarliestArrivalSPTService();
            sptService.maxDuration = (60 * cutoffMinutes);
            ShortestPathTree spt = sptService.getShortestPathTree(req);
            req.cleanup();
            if (spt != null) {
                TimeSurface surface = new TimeSurface(spt);
                surface.params = Maps.newHashMap();
                for (Map.Entry<String, List<String>> e : uriInfo.getQueryParameters().entrySet()) {
View Full Code Here


    @Override
    public void buildGraph(Graph graph, HashMap<Class<?>, Object> extra) {
        final Parser parser[] = new Parser[] {new Parser()};
        GeometryFactory geometryFactory = GeometryUtils.getGeometryFactory();
        EarliestArrivalSPTService earliestArrivalSPTService = new EarliestArrivalSPTService();
        earliestArrivalSPTService.maxDuration = (maxDuration);

        for (TransitStop ts : Iterables.filter(graph.getVertices(), TransitStop.class)) {
            // Only link street linkable stops
            if (!ts.isStreetLinkable())
                continue;
            LOG.trace("linking stop '{}' {}", ts.getStop(), ts);

            // Determine the set of pathway/transfer destinations
            Set<TransitStop> pathwayDestinations = new HashSet<TransitStop>();
            for (Edge e : ts.getOutgoing()) {
                if (e instanceof PathwayEdge || e instanceof SimpleTransfer) {
                    if (e.getToVertex() instanceof TransitStop) {
                        TransitStop to = (TransitStop) e.getToVertex();
                        pathwayDestinations.add(to);
                    }
                }
            }

            int n = 0;
            RoutingRequest routingRequest = new RoutingRequest(TraverseMode.WALK);
            routingRequest.clampInitialWait = (0L);
            routingRequest.setRoutingContext(graph, ts, null);
            routingRequest.rctx.pathParsers = parser;
            ShortestPathTree spt = earliestArrivalSPTService.getShortestPathTree(routingRequest);

            if (spt != null) {
                for (State state : spt.getAllStates()) {
                    Vertex vertex = state.getVertex();
                    if (ts == vertex) continue;
View Full Code Here

TOP

Related Classes of org.opentripplanner.routing.algorithm.EarliestArrivalSPTService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.