Package org.onebusaway.gtfs.model

Examples of org.onebusaway.gtfs.model.AgencyAndId


        Stop s1 = new Stop();
        s1.setName("transitVertex 1");
        s1.setLon(-74.005);
        s1.setLat(40.0099999);
        s1.setId(new AgencyAndId("A", "fleem station"));

        Stop s2 = new Stop();
        s2.setName("transitVertex 2");
        s2.setLon(-74.002);
        s2.setLat(40.0099999);
        s2.setId(new AgencyAndId("A", "morx station"));

        station1 = new TransitStop(graph, s1);
        station2 = new TransitStop(graph, s2);
        station1.addMode(TraverseMode.RAIL);
        station2.addMode(TraverseMode.RAIL);
View Full Code Here


                geometryFactory.getCoordinateSequenceFactory();
        CoordinateSequence coordinateSequence = coordinateSequenceFactory.create(coordinates);
        LineString geometry = new LineString(coordinateSequence, geometryFactory);
        ArrayList<Edge> hops = new ArrayList<Edge>(2);
        RoutingContext routingContext = new RoutingContext(routingRequest, graph, null, arrive);
        AgencyAndId agencyAndId = new AgencyAndId("Agency", "ID");
        Route route = new Route();
        ArrayList<StopTime> stopTimes = new ArrayList<StopTime>(3);
        StopTime stopDepartTime = new StopTime();
        StopTime stopDwellTime = new StopTime();
        StopTime stopArriveTime = new StopTime();
View Full Code Here

        when(station0.getY()).thenReturn(coordinates[0].y);
        when(station1.getX()).thenReturn(coordinates[1].x);
        when(station1.getY()).thenReturn(coordinates[1].y);

        RoutingContext routingContext = new RoutingContext(routingRequest, graph, null, arrive);
        AgencyAndId agencyAndId = new AgencyAndId("Agency", "ID");
        Route route = new Route();
        ArrayList<StopTime> stopTimes = new ArrayList<StopTime>(2);
        StopTime stopDepartTime = new StopTime();
        StopTime stopArriveTime = new StopTime();
        Stop stopDepart = new Stop();
        Stop stopArrive = new Stop();
        Trip trip = new Trip();

        routingContext.serviceDays =
                new ArrayList<ServiceDay>(Collections.singletonList(serviceDay));
        route.setId(agencyAndId);
        stopDepart.setId(new AgencyAndId("Station", "0"));
        stopArrive.setId(new AgencyAndId("Station", "1"));
        stopDepartTime.setStop(stopDepart);
        stopDepartTime.setDepartureTime(0);
        stopArriveTime.setArrivalTime(10);
        stopArriveTime.setStop(stopArrive);
        stopTimes.add(stopDepartTime);
View Full Code Here

        when(graph.getTimeZone()).thenReturn(TimeZone.getTimeZone("GMT"));

        ArrayList<Edge> hops = new ArrayList<Edge>(2);
        RoutingContext routingContext = new RoutingContext(routingRequest, graph, null, arrive);
        AgencyAndId agencyAndId = new AgencyAndId("Agency", "ID");
        Route route = new Route();
        ArrayList<StopTime> stopTimes = new ArrayList<StopTime>(2);
        StopTime stopDepartTime = new StopTime();
        StopTime stopDwellTime = new StopTime();
        StopTime stopArriveTime = new StopTime();
        Stop stopDepart = new Stop();
        Stop stopDwell = new Stop();
        Stop stopArrive = new Stop();
        Trip trip = new Trip();

        routingContext.serviceDays =
                new ArrayList<ServiceDay>(Collections.singletonList(serviceDay));
        route.setId(agencyAndId);
        stopDepart.setId(new AgencyAndId("Station", "0"));
        stopDwell.setId(new AgencyAndId("Station", "1"));
        stopArrive.setId(new AgencyAndId("Station", "2"));
        stopDepartTime.setStop(stopDepart);
        stopDepartTime.setDepartureTime(0);
        stopDwellTime.setArrivalTime(20);
        stopDwellTime.setStop(stopDwell);
        stopDwellTime.setDepartureTime(40);
View Full Code Here

                Set<T2<AgencyAndId, BannedStopSet>> usedTripDefs = new HashSet<T2<AgencyAndId, BannedStopSet>>();
                for (State s : path.states) {
                    if (s.getBackEdge() instanceof TransitBoardAlight) {
                        TransitBoardAlight tbae = (TransitBoardAlight) s.getBackEdge();
                        int boardingStopIndex = tbae.getStopIndex();
                        AgencyAndId tripId = s.getTripId();
                        BannedStopSet stopSet;
                        if (partial) {
                            stopSet = new BannedStopSet();
                            stopSet.add(boardingStopIndex);
                        } else {
View Full Code Here

        agency = graph.index.agencyForId.get("agency");
        assertEquals(agency.getId(), "agency");
        assertEquals(agency.getName(), "Fake Agency");

        /* Stops */
        graph.index.stopForId.get(new AgencyAndId("X", "Y"));

        /* Trips */
//        graph.index.tripForId;
//        graph.index.routeForId;
//        graph.index.serviceForId;
View Full Code Here

            }
        }
    }

    public void testSpatialIndex() {
        Stop stopJ = graph.index.stopForId.get(new AgencyAndId("agency", "J"));
        Stop stopL = graph.index.stopForId.get(new AgencyAndId("agency", "L"));
        Stop stopM = graph.index.stopForId.get(new AgencyAndId("agency", "M"));
        TransitStop stopvJ = graph.index.stopVertexForStop.get(stopJ);
        TransitStop stopvL = graph.index.stopVertexForStop.get(stopL);
        TransitStop stopvM = graph.index.stopVertexForStop.get(stopM);
        // There are a two other stops within 100 meters of stop J.
        Envelope env = new Envelope(new Coordinate(stopJ.getLon(), stopJ.getLat()));
View Full Code Here

        // The id of the second bus should be different
        assertEquals("190W1280", itinerary.legs.get(1).tripId);
        assertFalse("751W1330".equals(itinerary.legs.get(3).tripId));

        // Now apply a real-time update: let the to-trip have a delay of 3 seconds
        Trip trip = graph.index.tripForId.get(new AgencyAndId("TriMet", "751W1330"));
        TripPattern pattern = graph.index.patternForTrip.get(trip);
        applyUpdateToTripPattern(pattern, "751W1330", "7452", 79, 41228, 41228,
                ScheduleRelationship.SCHEDULED, 0, serviceDate);

        // Do the planning again
View Full Code Here

        assertEquals("750W1300", itinerary.legs.get(1).tripId);
        assertEquals("120W1320", itinerary.legs.get(3).tripId);

        // Now apply a real-time update: let the to-trip be early by 240 seconds,
        // resulting in a transfer time of 0 seconds
        Trip trip = graph.index.tripForId.get(new AgencyAndId("TriMet", "120W1320"));
        TripPattern pattern = graph.index.patternForTrip.get(trip);
        applyUpdateToTripPattern(pattern, "120W1320", "9756", 22, 41580, 41580,
                ScheduleRelationship.SCHEDULED, 0, serviceDate);

        // Do the planning again
View Full Code Here

        assertEquals("750W1300", itinerary.legs.get(1).tripId);
        assertEquals("120W1320", itinerary.legs.get(3).tripId);

        // Now apply a real-time update: let the to-trip be early by 240 seconds,
        // resulting in a transfer time of 0 seconds
        Trip trip = graph.index.tripForId.get(new AgencyAndId("TriMet", "120W1320"));
        TripPattern pattern = graph.index.patternForTrip.get(trip);
        applyUpdateToTripPattern(pattern, "120W1320", "9756", 22, 41580, 41580,
                ScheduleRelationship.SCHEDULED, 0, serviceDate);

        // Do the planning again
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.