Package org.opentripplanner.routing.graph

Examples of org.opentripplanner.routing.graph.Vertex$ValidEdgeTypes


        assertTrue(endTime < startTime + 60 * 60);
    }

    /* Somewhat hackish convenience method to grab a hop edge on a particular route leaving a particular stop. */
    private PatternHop getHopEdge(String stopId, String routeId) {
        Vertex stopDepartVertex = graph.getVertex("agency:" + stopId + "_depart");
        for (Edge edge : stopDepartVertex.getOutgoing()) {
            if (edge instanceof TransitBoardAlight) {
                TransitBoardAlight tba = ((TransitBoardAlight) edge);
                if (tba.boarding && tba.getPattern().route.getId().getId().equals(routeId)) {
                    for (Edge edge2: tba.getToVertex().getOutgoing()) {
                        if (edge2 instanceof PatternHop) {
View Full Code Here


        geom = hop.getGeometry();
        assertEquals(geom.getLength(), 1.73, 0.1);
    }

    public void testPickupDropoff() throws Exception {
        Vertex stop_o = graph.getVertex("agency:O_depart");
        Vertex stop_p = graph.getVertex("agency:P");
        assertEquals(2, stop_o.getOutgoing().size());

        long startTime = TestUtils.dateInSeconds("America/New_York", 2009, 8, 19, 12, 0, 0);
        RoutingRequest options = new RoutingRequest();
        options.dateTime = startTime;
View Full Code Here

        TransitStop e_arrive = (TransitStop) graph.getVertex("agency:E");
        TransitStop f_depart = (TransitStop) graph.getVertex("agency:F");
        Edge edge = new TransferEdge(e_arrive, f_depart, 10000, 10000);
       
        long startTime = TestUtils.dateInSeconds("America/New_York", 2009, 8, 18, 0, 50, 0);
        Vertex stop_b = graph.getVertex("agency:B_depart");
        Vertex stop_g = graph.getVertex("agency:G_arrive");
        RoutingRequest options = new RoutingRequest();
        options.dateTime = startTime;
        options.setRoutingContext(graph, stop_b, stop_g);
        ShortestPathTree spt = aStar.getShortestPathTree(options);
       
View Full Code Here

        e_arrive.removeOutgoing(edge);
        f_depart.removeIncoming(edge);
    }

    public void testTraverseMode() throws Exception {
        Vertex stop_a = graph.getVertex("agency:A_depart");
        Vertex stop_b = graph.getVertex("agency:B_arrive");

        ShortestPathTree spt;

        RoutingRequest options = new RoutingRequest();
        options.setModes(new TraverseModeSet("TRAINISH"));
View Full Code Here

        assertNotNull(spt.getPath(stop_b, false));
    }
   
    public void testTimelessStops() throws Exception {
        Vertex stop_d = graph.getVertex("agency:D");
        Vertex stop_c = graph.getVertex("agency:C");
        RoutingRequest options = new RoutingRequest();
        options.dateTime = TestUtils.dateInSeconds("America/New_York", 2009, 8, 1, 10, 0, 0);
        options.setRoutingContext(graph, stop_d, stop_c);
        ShortestPathTree spt = aStar.getShortestPathTree(options);
View Full Code Here

        assertNotNull(path);
        assertEquals(TestUtils.dateInSeconds("America/New_York", 2009, 8, 1, 11, 0, 0), path.getEndTime());
    }

    public void testTripBikesAllowed() throws Exception {
        Vertex stop_a = graph.getVertex("agency:A");
        Vertex stop_b = graph.getVertex("agency:B");
        Vertex stop_c = graph.getVertex("agency:C");
        Vertex stop_d = graph.getVertex("agency:D");

        RoutingRequest options = new RoutingRequest();
        options.modes.setWalk(false);
        options.modes.setBicycle(true);
        options.modes.setTransit(true);
View Full Code Here

        path = spt.getPath(stop_d, false);
        assertNotNull(path);
    }

    public void testWheelchairAccessible() throws Exception {
        Vertex near_a = graph.getVertex("near_1_agency_A");
        Vertex near_b = graph.getVertex("near_1_agency_B");
        Vertex near_c = graph.getVertex("near_1_agency_C");
        Vertex near_e = graph.getVertex("near_1_agency_E");

        Vertex stop_d = graph.getVertex("agency:D");
        Vertex split_d = null;
        for (StreetTransitLink e : Iterables.filter(stop_d.getOutgoing(), StreetTransitLink.class)) {
            split_d = e.getToVertex();
        }
       
        RoutingRequest options = new RoutingRequest();
View Full Code Here

         *  There's a trip from S to T at 8:50 and a second one at 9:50. 
         *  To get to S by 8:50, we need to take trip 12.1 from Q to R, and 13.1
         *  from R to S.  If we take the direct-but-slower 11.1, we'll miss
         *  the 8:50 and have to catch the 9:50.
         */
        Vertex destination = graph.getVertex("agency:T");
        RoutingRequest options = new RoutingRequest();
        // test is designed such that transfers must be instantaneous
        options.transferSlack = (0);
        GregorianCalendar startTime = new GregorianCalendar(2009, 11, 2, 8, 30, 0);
        startTime.setTimeZone(TimeZone.getTimeZone("America/New_York"));
        options.dateTime = TestUtils.toSeconds(startTime);
        options.setRoutingContext(graph, "agency:Q", destination.getLabel());
        ShortestPathTree spt = aStar.getShortestPathTree(options);
        GraphPath path = spt.getPath(destination, false);

        long endTime = path.getEndTime();
        Calendar c = new GregorianCalendar();
View Full Code Here

        c.setTimeInMillis(endTime * 1000L);
        assertTrue(endTime - TestUtils.toSeconds(startTime) < 7200);
    }

    public void testFrequencies() {
        Vertex stop_u = graph.getVertex("agency:U_depart");
        Vertex stop_v = graph.getVertex("agency:V_arrive");

        ShortestPathTree spt;
        GraphPath path;

        RoutingRequest options = new RoutingRequest();
View Full Code Here

        // TODO more detailed testing of frequencies

    }
   
    public void testFewestTransfers() {
        Vertex stop_c = graph.getVertex("agency:C");
        Vertex stop_d = graph.getVertex("agency:D");
        RoutingRequest options = new RoutingRequest();
        options.optimize = OptimizeType.QUICK;
        options.dateTime = TestUtils.dateInSeconds("America/New_York", 2009, 8, 1, 16, 0, 0);
        options.setRoutingContext(graph, stop_c, stop_d)
               
View Full Code Here

TOP

Related Classes of org.opentripplanner.routing.graph.Vertex$ValidEdgeTypes

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.