Package org.opentripplanner.routing.core

Examples of org.opentripplanner.routing.core.RoutingRequest.cleanup()


            sptRequestA.setMode(TraverseMode.WALK); // fall back to walk mode
            sptRequestA.setRoutingContext(graphService.getGraph());
        }
        ShortestPathTree sptA = sptService.getShortestPathTree(sptRequestA);
        StreetLocation origin = (StreetLocation) sptRequestA.rctx.fromVertex;
        sptRequestA.cleanup(); // remove inserted points

        // create a LineString for display
        Coordinate pathToStreetCoords[] = new Coordinate[2];
        pathToStreetCoords[0] = dropPoint;
        pathToStreetCoords[1] = origin.getCoordinate();
View Full Code Here


          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()) {
                    // include only the first instance of each query parameter
View Full Code Here

                LOG.warn("Error while planning path: ", e);
            response.setError(error);
        } finally {
            if (request != null) {
                response.debugOutput = request.rctx.debugOutput;
                request.cleanup(); // TODO verify that this is being done on Analyst web services
            }      
        }
        return response;
    }
View Full Code Here

        // now's a good time to set showGraph's SPT drawing weights
        showGraph.setSPTFlattening( Float.parseFloat(sptFlattening.getText()) );
        showGraph.setSPTThickness( Float.parseFloat(sptThickness.getText()) );
        showGraph.redraw();
       
        options.cleanup();
    }
   
  private void showPathsInPanel(List<GraphPath> paths) {
    // show paths in a list panel
    DefaultListModel<PathPrinter> data = new DefaultListModel<PathPrinter>();
View Full Code Here

            assertNotSame(s.getVertex(), graph.getVertex("bottom"));
            assertNotSame(s.getVertex(), graph.getVertex("bottomBack"));
        }

        // Number of vertices and edges should be the same as before after a cleanup.
        options.cleanup();
        assertEquals(nVertices, graph.getVertices().size());
        assertEquals(nEdges, graph.getEdges().size());

        /*
         * Now, the right edge is not bikeable. But the user can walk their bike. So here are some tests that prove (a) that walking bikes works, but
View Full Code Here

            assertNotSame(s.getVertex(), graph.getVertex("left"));
            assertNotSame(s.getVertex(), graph.getVertex("leftBack"));
        }

        // Number of vertices and edges should be the same as before after a cleanup.
        options.cleanup();
        assertEquals(nVertices, graph.getVertices().size());
        assertEquals(nEdges, graph.getEdges().size());

        start = StreetLocation.createStreetLocation(graph, "start2", "start2",
                filter(turns, StreetEdge.class),
View Full Code Here

            assertNotSame(s.getVertex(), graph.getVertex("right"));
            assertNotSame(s.getVertex(), graph.getVertex("rightBack"));
        }

        // Number of vertices and edges should be the same as before after a cleanup.
        options.cleanup();
        assertEquals(nVertices, graph.getVertices().size());
        assertEquals(nEdges, graph.getEdges().size());
    }
   
    public void testRouteToSameEdge() {
View Full Code Here

            Edge startBackEdge, Vertex u, Vertex v) {
        RoutingRequest options = proto.clone();
        options.setRoutingContext(_graph, startBackEdge, u, v);
        ShortestPathTree tree = sptService.getShortestPathTree(options);
        GraphPath path = tree.getPath(v, false);
        options.cleanup();
        return path;
    }
   
    private void checkTriangleInequality() {
        checkTriangleInequality(null);
View Full Code Here

       
        GenericAStar aStar = new GenericAStar();
       
        ShortestPathTree tree = aStar.getShortestPathTree(options);
        GraphPath path = tree.getPath(end, false);
        options.cleanup();
        assertNotNull(path);
       
        double startEndWeight = path.getWeight();
        int startEndDuration = path.getDuration();
        assertTrue(startEndWeight > 0);
View Full Code Here

            RoutingRequest req = buildRequest(oi);
            if (req != null) {
                ShortestPathTree spt = sptService.getShortestPathTree(req);
                // ResultSet should be a local to avoid memory leak
                ResultSet results = ResultSet.forTravelTimes(destinations, spt);
                req.cleanup();
                switch (mode) {
                case ACCUMULATE:
                    synchronized (aggregateResultSet) {
                        accumulator.accumulate(oi.input, results, aggregateResultSet);
                    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.