Examples of AlertPatch


Examples of org.opentripplanner.routing.alertpatch.AlertPatch

                v56, v58, Collections.singleton(""));
        StreetBikeRentalLink e59 = new StreetBikeRentalLink(
                v58, v60);

        // Alert for testing GTFS-RT
        AlertPatch alertPatch = new AlertPatch();

        alertPatch.setTimePeriods(Collections.singletonList(new TimePeriod(0, Long.MAX_VALUE)));
        alertPatch.setAlert(Alert.createSimpleAlerts(alertsExample));

        // Edge initialization that can't be done using the constructor
        e3.setElevationProfile(elevation3, false);
        e17.add(firstTrip, secondTrip);
        e39.setElevationProfile(elevation39, false);
View Full Code Here

Examples of org.opentripplanner.routing.alertpatch.AlertPatch

                log.error("Empty agency id (and no default set) in feed; other ids are route "
                        + routeId + " and stop " + stopId);
                continue;
            }

            AlertPatch patch = new AlertPatch();
            if (routeId != null) {
                patch.setRoute(new AgencyAndId(agencyId, routeId));
            }
            if (tripId != null) {
                patch.setTrip(new AgencyAndId(agencyId, tripId));
            }
            if (stopId != null) {
                patch.setStop(new AgencyAndId(agencyId, stopId));
            }
            if(agencyId != null && routeId == null && tripId == null && stopId == null) {
                patch.setAgencyId(agencyId);
            }
            patch.setTimePeriods(periods);
            patch.setAlert(alertText);

            patch.setId(patchId);
            patchIds.add(patchId);

            alertPatchService.apply(patch);
        }
    }
View Full Code Here

Examples of org.opentripplanner.routing.alertpatch.AlertPatch

import org.opentripplanner.routing.alertpatch.AlertPatch;

public class GraphTest {
    @Test
    public final void testAlertPatch() {
        final AlertPatch alertPatches[][] = new AlertPatch[10][];
        Graph graph = new Graph();
        Vertex vertex0 = new SimpleConcreteVertex(graph, "Vertex 0", 0, 0);
        Vertex vertex1 = new SimpleConcreteVertex(graph, "Vertex 1", 0, 180);
        Edge edge0 = new SimpleConcreteEdge(vertex0, vertex1);
        Edge edge1 = new SimpleConcreteEdge(vertex1, vertex0);
        AlertPatch alertPatch0 = new AlertPatch();
        AlertPatch alertPatch1 = new AlertPatch();
        AlertPatch alertPatch2 = new AlertPatch();
        AlertPatch alertPatch3 = new AlertPatch();

        alertPatch0.setId("A");
        alertPatch1.setId("A");
        alertPatch2.setId("B");
        alertPatch3.setId("C");

        graph.addAlertPatch(null, null);
        graph.addAlertPatch(null, alertPatch0);
        graph.addAlertPatch(null, alertPatch3);
        graph.addAlertPatch(edge0, null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.