Package org.opentripplanner.routing.edgetype

Examples of org.opentripplanner.routing.edgetype.TripPattern


    @Test
    public void testHandleCanceledTrip() throws InvalidProtocolBufferException {
        AgencyAndId tripId = new AgencyAndId("agency", "1.1");
        AgencyAndId tripId2 = new AgencyAndId("agency", "1.2");
        Trip trip = graph.index.tripForId.get(tripId);
        TripPattern pattern = graph.index.patternForTrip.get(trip);
        int tripIndex = pattern.scheduledTimetable.getTripIndex(tripId);
        int tripIndex2 = pattern.scheduledTimetable.getTripIndex(tripId2);

        updater.applyTripUpdates(Arrays.asList(TripUpdate.parseFrom(cancellation)), "agency");
View Full Code Here


    @Test
    public void testHandleModifiedTrip() {
        AgencyAndId tripId = new AgencyAndId("agency", "1.1");
        AgencyAndId tripId2 = new AgencyAndId("agency", "1.2");
        Trip trip = graph.index.tripForId.get(tripId);
        TripPattern pattern = graph.index.patternForTrip.get(trip);
        int tripIndex = pattern.scheduledTimetable.getTripIndex(tripId);
        int tripIndex2 = pattern.scheduledTimetable.getTripIndex(tripId2);

        TripDescriptor.Builder tripDescriptorBuilder = TripDescriptor.newBuilder();
View Full Code Here

    @Test
    public void testPurgeExpiredData() throws InvalidProtocolBufferException {
        AgencyAndId tripId = new AgencyAndId("agency", "1.1");
        ServiceDate previously = serviceDate.previous().previous(); // Just to be safe...
        Trip trip = graph.index.tripForId.get(tripId);
        TripPattern pattern = graph.index.patternForTrip.get(trip);

        updater.maxSnapshotFrequency = (0);
        updater.purgeExpiredData = (false);

        updater.applyTripUpdates(Arrays.asList(TripUpdate.parseFrom(cancellation)), "agency");
View Full Code Here

                        // Vertex fromv = ph.getFromVertex();
                        // Vertex tov = ph.getToVertex();
                        double distance = ph.getDistance();
                        if (distance < 3)
                            continue;
                        TripPattern ttp = ph.getPattern();
                        List<Trip> trips = ttp.getTrips();
                        int hop = ph.stopIndex;
                        String route = ttp.route.getId().toString();
                        for (int trip = 0; trip < trips.size(); trip++){
                            int time = ttp.scheduledTimetable.getTripTimes(trip).getRunningTime(hop);
                            double speed = distance / time;
View Full Code Here

                        "cumulativePatterns", "empiricalDistPatterns",
                        "cumulativeTrips", "empiricalDistTrips" } );
                Set<TripPattern> patterns = new HashSet<TripPattern>();
                for (Vertex v : graph.getVertices()) {
                    for (PatternHop ph : Iterables.filter(v.getOutgoing(), PatternHop.class)) {
                        TripPattern ttp = ph.getPattern();
                        patterns.add(ttp);
                    }
                }
                Multiset<Integer> counts = TreeMultiset.create();
                int nPatterns = patterns.size();
                LOG.info("total number of patterns is: {}", nPatterns);
                int nTrips = 0;
                for (TripPattern ttp : patterns) {
                    List<Trip> trips = ttp.getTrips();
                    counts.add(trips.size());
                    nTrips += trips.size();
                }
                LOG.info("total number of trips is: {}", nTrips);
                LOG.info("average number of trips per pattern is: {}", nTrips/nPatterns);
View Full Code Here

TOP

Related Classes of org.opentripplanner.routing.edgetype.TripPattern

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.