Package org.onebusaway.gtfs.model

Examples of org.onebusaway.gtfs.model.Route


            String origin = rule.getOriginId();
            String destination = rule.getDestinationId();
            if (origin != null || destination != null) {
                fareRule.addOriginDestination(origin, destination);
            }
            Route route = rule.getRoute();
            if (route != null) {
                AgencyAndId routeId = route.getId();
                fareRule.addRoute(routeId);
            }
        }
    }
View Full Code Here


            }
        }

        /* check if route banned for this plan */
        if (bannedRoutes != null) {
            Route route = trip.getRoute();
            if (bannedRoutes.matches(route)) {
                return true;
            }
        }

View Full Code Here

        Collection<Transfer> transfers = _dao.getAllTransfers();
        TransferTable transferTable = graph.getTransferTable();
        for (Transfer t : transfers) {
            Stop fromStop = t.getFromStop();
            Stop toStop = t.getToStop();
            Route fromRoute = t.getFromRoute();
            Route toRoute = t.getToRoute();
            Trip fromTrip = t.getFromTrip();
            Trip toTrip = t.getToTrip();
            Vertex fromVertex = context.stopArriveNodes.get(fromStop);
            Vertex toVertex = context.stopDepartNodes.get(toStop);
            switch (t.getTransferType()) {
View Full Code Here

        this.id = id;
    }

    public void apply(Graph graph) {
        Agency agency = this.agency != null ? graph.index.agencyForId.get(this.agency) : null;
        Route route = this.route != null ? graph.index.routeForId.get(this.route) : null;
        Stop stop = this.stop != null ? graph.index.stopForId.get(this.stop) : null;
        Trip trip = this.trip != null ? graph.index.tripForId.get(this.trip) : null;

        if (route != null || trip != null || agency != null) {
            Collection<TripPattern> tripPatterns;
View Full Code Here

        }
    }

    public void remove(Graph graph) {
        Agency agency = this.agency != null ? graph.index.agencyForId.get(this.agency) : null;
        Route route = this.route != null ? graph.index.routeForId.get(this.route) : null;
        Stop stop = this.stop != null ? graph.index.stopForId.get(this.stop) : null;
        Trip trip = this.trip != null ? graph.index.tripForId.get(this.trip) : null;

        if (route != null || trip != null || agency != null) {
            Collection<TripPattern> tripPatterns;
View Full Code Here

    public List<SegmentPattern> segmentPatterns = Lists.newArrayList();
    public String startTime;
    public String endTime;

    public Segment (Ride ride) {
        Route route = ride.patternRides.get(0).pattern.route;
        from = ride.from.id;
        to = ride.to.id;
        fromName = ride.from.name;
        toName = ride.to.name;
        rideStats = ride.rideStats;
View Full Code Here

    public void testTransfers() throws Exception {
        TransferTable transferTable = graph.getTransferTable();
       
        // create dummy routes and trips
        Route fromRoute = new Route();
        fromRoute.setId(new AgencyAndId("agency", "1"));
        Trip fromTrip = new Trip();
        fromTrip.setId(new AgencyAndId("agency", "1.1"));
        fromTrip.setRoute(fromRoute);
        Route toRoute = new Route();
        toRoute.setId(new AgencyAndId("agency", "2"));
        Trip toTrip = new Trip();
        toTrip.setId(new AgencyAndId("agency", "2.1"));
        toTrip.setRoute(toRoute);
        Trip toTrip2 = new Trip();
        toTrip2.setId(new AgencyAndId("agency", "2.2"));
View Full Code Here

    @Test
    public void testBikesAllowed() {
        Graph graph = new Graph();
        Trip trip = new Trip();
        Route route = new Route();
        trip.setRoute(route);
        List<StopTime> stopTimes = Arrays.asList(new StopTime(), new StopTime());
        TripTimes s = new TripTimes(trip, stopTimes, new Deduplicator());

        RoutingRequest request = new RoutingRequest(TraverseMode.BICYCLE);
View Full Code Here

public class BikeAccessTest {

    @Test
    public void testBikesAllowed() {
        Trip trip = new Trip();
        Route route = new Route();
        trip.setRoute(route);

        assertEquals(BikeAccess.UNKNOWN, BikeAccess.fromTrip(trip));
        trip.setBikesAllowed(1);
        assertEquals(BikeAccess.ALLOWED, BikeAccess.fromTrip(trip));
        trip.setBikesAllowed(2);
        assertEquals(BikeAccess.NOT_ALLOWED, BikeAccess.fromTrip(trip));
        route.setBikesAllowed(1);
        assertEquals(BikeAccess.NOT_ALLOWED, BikeAccess.fromTrip(trip));
        trip.setBikesAllowed(0);
        assertEquals(BikeAccess.ALLOWED, BikeAccess.fromTrip(trip));
        route.setBikesAllowed(2);
        assertEquals(BikeAccess.NOT_ALLOWED, BikeAccess.fromTrip(trip));
    }
View Full Code Here

    @SuppressWarnings("deprecation")
    @Test
    public void testTripBikesAllowed() {
        Trip trip = new Trip();
        Route route = new Route();
        trip.setRoute(route);

        assertEquals(BikeAccess.UNKNOWN, BikeAccess.fromTrip(trip));
        trip.setTripBikesAllowed(2);
        assertEquals(BikeAccess.ALLOWED, BikeAccess.fromTrip(trip));
        trip.setTripBikesAllowed(1);
        assertEquals(BikeAccess.NOT_ALLOWED, BikeAccess.fromTrip(trip));
        route.setRouteBikesAllowed(2);
        assertEquals(BikeAccess.NOT_ALLOWED, BikeAccess.fromTrip(trip));
        trip.setTripBikesAllowed(0);
        assertEquals(BikeAccess.ALLOWED, BikeAccess.fromTrip(trip));
        route.setRouteBikesAllowed(1);
        assertEquals(BikeAccess.NOT_ALLOWED, BikeAccess.fromTrip(trip));
    }
View Full Code Here

TOP

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

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.