Package org.onebusaway.transit_data_federation.impl.transit_graph

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.TransitGraphImpl$BlockEntryAdapter


  }
 
  @Test
  public void testThreeInARowDuplicateRemoval() {

    TransitGraphImpl graph = new TransitGraphImpl();

    Stop stopA = new Stop();
    stopA.setId(aid("stopA"));
    graph.putStopEntry(stop("stopA", 47.672207391799056, -122.387855896286));

    Stop stopB = new Stop();
    stopB.setId(aid("stopB"));
    graph.putStopEntry(stop("stopB", 47.66852277218285, -122.3853882639923));

    Stop stopC = new Stop();
    stopC.setId(aid("stopC"));
    graph.putStopEntry(stop("stopC", 47.66847942216854, -122.37545336180114));

    Stop stopD = new Stop();
    stopD.setId(aid("stopD"));
    graph.putStopEntry(stop("stopD", 47.66947942216854, -122.37545336180114));

    graph.refreshStopMapping();

    Agency agency = new Agency();
    agency.setId("1");
    agency.setTimezone("America/Los_Angeles");
View Full Code Here


  }
 
  @Test
  public void test() {

    TransitGraphImpl graph = new TransitGraphImpl();

    Stop stopA = new Stop();
    stopA.setId(aid("stopA"));
    graph.putStopEntry(stop("stopA", 47.672207391799056, -122.387855896286));

    Stop stopB = new Stop();
    stopB.setId(aid("stopB"));
    graph.putStopEntry(stop("stopB", 47.66852277218285, -122.3853882639923));

    Stop stopC = new Stop();
    stopC.setId(aid("stopC"));
    graph.putStopEntry(stop("stopC", 47.66847942216854, -122.37545336180114));

    graph.refreshStopMapping();

    Agency agency = new Agency();
    agency.setId("1");
    agency.setTimezone("America/Los_Angeles");
View Full Code Here

    routeB.setId(new AgencyAndId("A", "routeB"));

    Mockito.when(gtfsDao.getAllRoutes()).thenReturn(
        Arrays.asList(routeA, routeB));

    TransitGraphImpl graph = new TransitGraphImpl();

    RouteEntriesFactory factory = new RouteEntriesFactory();
    factory.setGtfsDao(gtfsDao);
    factory.setUniqueService(new UniqueServiceImpl());
    factory.processRoutes(graph);

    RouteEntryImpl routeEntryA = graph.getRouteForId(routeA.getId());

    RouteEntryImpl routeEntryB = graph.getRouteForId(routeB.getId());

    List<RouteEntry> routes = graph.getAllRoutes();
    assertEquals(2, routes.size());
    assertTrue(routes.contains(routeEntryA));
    assertTrue(routes.contains(routeEntryB));
  }
View Full Code Here

  }

  @Transactional
  public void run() {

    TransitGraphImpl graph = new TransitGraphImpl();

    _agencyEntriesFactory.processAgencies(graph);
    _stopEntriesFactory.processStops(graph);
    _routeEntriesFactory.processRoutes(graph);
    _routeCollectionEntriesFactory.processRouteCollections(graph);
    _tripEntriesFactory.processTrips(graph);
    _blockEntriesFactory.processBlocks(graph);
    _frequencyEntriesFactory.processFrequencies(graph);

    /**
     * Make sure the graph is initialized as result of the graph building
     * process, as it will be used by subsequent tasks
     */
    graph.initialize();

    try {

      ObjectSerializationLibrary.writeObject(_bundle.getTransitGraphPath(),
          graph);
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.impl.transit_graph.TransitGraphImpl$BlockEntryAdapter

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.