Package org.onebusaway.gtfs.model

Examples of org.onebusaway.gtfs.model.AgencyAndId


        rnp1.setTimePeriods(Collections.singletonList(new TimePeriod(
                0, 1000L * 60 * 60 * 24 * 365 * 40))); // until ~1/1/2011
        Alert note1 = Alert.createSimpleAlerts("The route note");
        rnp1.setAlert(note1);
        rnp1.setId("id1");
        rnp1.setRoute(new AgencyAndId("agency", "1"));
        rnp1.apply(graph);

        Vertex stop_a = graph.getVertex("agency:A");
        Vertex stop_e = graph.getVertex("agency:E_arrive");

View Full Code Here


     * Test transfer table
     */
    public void testTransferTable() {
        // Setup from stop
        Stop fromStop = new Stop();
        fromStop.setId(new AgencyAndId("A1", "S1"));
       
        // Setup to stop
        Stop toStop = new Stop();
        toStop.setId(new AgencyAndId("A1", "S2"));
       
        // Setup to stop parent
        Stop toStopParent = new Stop();
        toStopParent.setId(new AgencyAndId("A1", "S3"));
        toStop.setParentStation("S3");
       
        // Setup from trip with route
        Route fromRoute = new Route();
        fromRoute.setId(new AgencyAndId("A1", "R1"));
        Trip fromTrip = new Trip();
        fromTrip.setId(new AgencyAndId("A1", "T1"));
        fromTrip.setRoute(fromRoute);
       
        // Setup to trip with route
        Route toRoute = new Route();
        toRoute.setId(new AgencyAndId("A1", "R2"));
        Trip toTrip = new Trip();
        toTrip.setId(new AgencyAndId("A1", "T2"));
        toTrip.setRoute(toRoute);
       
        // Setup second to trip with route
        Route toRoute2 = new Route();
        toRoute2.setId(new AgencyAndId("A1", "R3"));
        Trip toTrip2 = new Trip();
        toTrip2.setId(new AgencyAndId("A1", "T3"));
        toTrip2.setRoute(toRoute2);
       
        // Create transfer table
        TransferTable table = new TransferTable();
       
View Full Code Here

     * Test different stop transfers
     */
    public void testStopTransfer() {
        // Setup from trip with route
        Route fromRoute = new Route();
        fromRoute.setId(new AgencyAndId("A1", "R1"));
        Trip fromTrip = new Trip();
        fromTrip.setId(new AgencyAndId("A1", "T1"));
        fromTrip.setRoute(fromRoute);
       
        // Setup to trip with route
        Route toRoute = new Route();
        toRoute.setId(new AgencyAndId("A1", "R2"));
        Trip toTrip = new Trip();
        toTrip.setId(new AgencyAndId("A1", "T2"));
        toTrip.setRoute(toRoute);
       
        // Setup second to trip with route
        Route toRoute2 = new Route();
        toRoute2.setId(new AgencyAndId("A1", "R3"));
        Trip toTrip2 = new Trip();
        toTrip2.setId(new AgencyAndId("A1", "T3"));
        toTrip2.setRoute(toRoute2);
       
        // Create StopTransfer
        StopTransfer transfer = new StopTransfer();
        assertEquals(StopTransfer.UNKNOWN_TRANSFER, transfer.getTransferTime(fromTrip, toTrip));
View Full Code Here

        assertTrue(req.intermediatesEffectivelyOrdered());       
    }

    @Test
    public void testPreferencesPenaltyForRoute() {
        AgencyAndId agencyAndId = new AgencyAndId();
        Route route = new Route();
        Trip trip = new Trip();
        RoutingRequest routingRequest = new RoutingRequest();

        trip.setRoute(route);
View Full Code Here

        assertEquals("8.1", trips.get(0).getId().getId());
        assertEquals("4.2", trips.get(1).getId().getId());

        // Add transfer to table, transfer time was 27600 seconds
        Stop stopK = new Stop();
        stopK.setId(new AgencyAndId("agency", "K"));
        Stop stopF = new Stop();
        stopF.setId(new AgencyAndId("agency", "F"));
        table.addTransferTime(stopK, stopF, null, null, null, null, 27601);

        // Plan journey
        path = planJourney(options);
        trips = extractTrips(path);
View Full Code Here

        assertEquals("8.1", trips.get(0).getId().getId());
        assertEquals("4.2", trips.get(1).getId().getId());

        // Add transfer to table, transfer time was 27600 seconds
        Stop stopK = new Stop();
        stopK.setId(new AgencyAndId("agency", "K"));
        Stop stopF = new Stop();
        stopF.setId(new AgencyAndId("agency", "F"));
        table.addTransferTime(stopK, stopF, null, null, null, null, 27601);

        // Plan journey
        path = planJourney(options, true);
        trips = extractTrips(path);
View Full Code Here

        assertTrue(time >= 0);

        // Add transfer to table such that the next trip will be chosen
        // (there are 3600 seconds between trips), transfer time was 75 seconds
        Stop stopP = new Stop();
        stopP.setId(new AgencyAndId("agency", "P"));
        Stop stopU = new Stop();
        stopU.setId(new AgencyAndId("agency", "U"));
        table.addTransferTime(stopP, stopU, null, null, null, null, 3675);

        // Plan journey
        path = planJourney(options);
        trips = extractTrips(path);
View Full Code Here

        assertTrue(time >= 0);

        // Add transfer to table such that the next trip will be chosen
        // (there are 3600 seconds between trips), transfer time was 75 seconds
        Stop stopV = new Stop();
        stopV.setId(new AgencyAndId("agency", "V"));
        Stop stopI = new Stop();
        stopI.setId(new AgencyAndId("agency", "I"));
        table.addTransferTime(stopV, stopI, null, null, null, null, 3675);

        // Plan journey
        path = planJourney(options);
        trips = extractTrips(path);
View Full Code Here

        assertEquals("8.1", trips.get(0).getId().getId());
        assertEquals("4.2", trips.get(1).getId().getId());

        // Add forbidden transfer to table
        Stop stopK = new Stop();
        stopK.setId(new AgencyAndId("agency", "K"));
        Stop stopF = new Stop();
        stopF.setId(new AgencyAndId("agency", "F"));
        table.addTransferTime(stopK, stopF, null, null, null, null,
                StopTransfer.FORBIDDEN_TRANSFER);

        // Plan journey
        path = planJourney(options);
View Full Code Here

        assertEquals("15.1", trips.get(0).getId().getId());
        assertEquals("5.1", trips.get(1).getId().getId());

        // Add forbidden transfer to table
        Stop stopV = new Stop();
        stopV.setId(new AgencyAndId("agency", "V"));
        Stop stopI = new Stop();
        stopI.setId(new AgencyAndId("agency", "I"));
        table.addTransferTime(stopV, stopI, null, null, null, null,
                StopTransfer.FORBIDDEN_TRANSFER);

        // Plan journey
        path = planJourney(options);
View Full Code Here

TOP

Related Classes of org.onebusaway.gtfs.model.AgencyAndId

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.