Package org.opentripplanner.routing.graph

Examples of org.opentripplanner.routing.graph.Graph


    private IntersectionVertex v0, v1, v2;
    private RoutingRequest proto;

    @Before
    public void before() {
        _graph = new Graph();

        v0 = vertex("maple_0th", 0.0, 0.0); // label, X, Y
        v1 = vertex("maple_1st", 2.0, 2.0);
        v2 = vertex("maple_2nd", 1.0, 2.0);
       
View Full Code Here


    private IntersectionVertex v1, v2, v3, v4;
    private StreetEdge e1, e1Reverse, e2, e3;
   
    @Before
    public void setUp() throws Exception {
        _graph = new Graph();

        // Graph for a fictional grid city with turn restrictions
        v1 = vertex("maple_1st", 2.0, 2.0);
        v2 = vertex("maple_2nd", 1.0, 2.0);
        v3 = vertex("maple_3rd", 0.0, 2.0);
View Full Code Here

   
    @BeforeClass
    public static void setUp() throws Exception {

        context = GtfsLibrary.readGtfs(new File(ConstantsForTests.FAKE_GTFS));
        graph = new Graph();

        GTFSPatternHopFactory factory = new GTFSPatternHopFactory(context);
        factory.run(graph);
        graph.putService(CalendarServiceData.class,
                GtfsLibrary.createCalendarServiceData(context.getDao()));
View Full Code Here

            // no intermediate places specified, chain to main path service
            return chainedPathService.getPaths(options);
        }

        /* intermediate places present, intercept request */
        Graph graph = graphService.getGraph(options.routerId);
        long time = options.dateTime;
        options.setRoutingContext(graph);
        options.rctx.pathParsers = new PathParser[] { new BasicPathParser(),
                new NoThruTrafficPathParser() };

View Full Code Here

                     */
                    graph = null;
                    graph = loadGraph();
                }
            } else {
                Graph newGraph = loadGraph();
                if (newGraph != null) {
                    // Load OK
                    if (graph != null)
                        configurator.shutdownGraph(graph);
                    graph = newGraph; // Assignment in java is atomic
View Full Code Here

     * graph with dynamic updaters.
     *
     * @return
     */
    private Graph loadGraph() {
        final Graph graph;
        try (InputStream is = graphInputStream.getGraphInputStream()) {
            LOG.info("Loading graph...");
            try {
                graph = Graph.load(new ObjectInputStream(is), loadLevel, streetVertexIndexFactory);
            } catch (Exception ex) {
View Full Code Here

    private GtfsContext context;

    public void setUp() throws Exception {

        context = GtfsLibrary.readGtfs(new File(ConstantsForTests.FAKE_GTFS));
        graph = new Graph();

        GTFSPatternHopFactory factory = new GTFSPatternHopFactory(context);
        factory.run(graph);
        graph.putService(CalendarServiceData.class, GtfsLibrary.createCalendarServiceData(context.getDao()));
       
View Full Code Here

        final List<TripUpdate> updates =
                Collections.singletonList(TripUpdate.newBuilder().buildPartial());
        final TripUpdateGraphWriterRunnable tripUpdateGraphWriterRunnable =
                new TripUpdateGraphWriterRunnable(updates, agencyId);

        Graph graph = mock(Graph.class);
        TimetableSnapshotSource timetableSnapshotSource = mock(TimetableSnapshotSource.class);

        graph.timetableSnapshotSource = timetableSnapshotSource;

        tripUpdateGraphWriterRunnable.run(graph);
View Full Code Here

    private GenericAStar aStar = new GenericAStar();

    public void setUp() throws Exception {
        GtfsContext context = GtfsLibrary.readGtfs(new File(ConstantsForTests.FAKE_GTFS));
        graph = new Graph();
        GTFSPatternHopFactory factory = new GTFSPatternHopFactory(context);
        factory.run(graph);
        graph.putService(CalendarServiceData.class, GtfsLibrary.createCalendarServiceData(context.getDao()));
    }
View Full Code Here

    @BeforeClass
    public static void onlyOnce() throws Exception {

        extra = new HashMap<Class<?>, Object>();
        _graph = new Graph();

        OpenStreetMapGraphBuilderImpl loader = new OpenStreetMapGraphBuilderImpl();
        loader.setDefaultWayPropertySetSource(new DefaultWayPropertySetSource());
        FileBasedOpenStreetMapProviderImpl provider = new FileBasedOpenStreetMapProviderImpl();
View Full Code Here

TOP

Related Classes of org.opentripplanner.routing.graph.Graph

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.