Examples of TripEntryImpl


Examples of org.onebusaway.transit_data_federation.impl.transit_graph.TripEntryImpl

  public void test() {

    StopEntryImpl stopA = stop("stopA", 47.0, -122.0);
    StopEntryImpl stopB = stop("stopB", 47.1, -122.1);

    TripEntryImpl tripA = trip("tripA", "sA", 300.0);
    StopTimeEntryImpl st0 = stopTime(0, stopA, tripA, time(9, 00), time(9, 05),
        100.0);
    StopTimeEntryImpl st1 = stopTime(1, stopB, tripA, time(9, 30), time(9, 35),
        200.0);

    TripEntryImpl tripB = trip("tripB", "sA", 300.0);
    StopTimeEntryImpl st2 = stopTime(2, stopA, tripB, time(10, 00),
        time(10, 05), 100.0);
    StopTimeEntryImpl st3 = stopTime(3, stopB, tripB, time(10, 30),
        time(10, 35), 200.0);

    TripEntryImpl tripC = trip("tripC", "sB", 300.0);
    StopTimeEntryImpl st4 = stopTime(4, stopA, tripC, time(11, 00),
        time(11, 05), 100.0);
    StopTimeEntryImpl st5 = stopTime(5, stopB, tripC, time(11, 30),
        time(11, 35), 200.0);

    TripEntryImpl tripD = trip("tripD", "sB", 300.0);
    StopTimeEntryImpl st6 = stopTime(6, stopA, tripD, time(12, 00),
        time(12, 05), 100.0);
    StopTimeEntryImpl st7 = stopTime(7, stopB, tripD, time(12, 30),
        time(12, 35), 200.0);
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.TripEntryImpl

    Trip trip = new Trip();
    trip.setRoute(route);
    trip.setServiceId(aid("serviceId"));

    TripEntryImpl tripEntry = trip("trip");

    StopTime stA = new StopTime();
    stA.setId(100);
    stA.setArrivalTime(time(9, 00));
    stA.setDepartureTime(time(9, 05));
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.TripEntryImpl

    Trip trip = new Trip();
    trip.setRoute(route);
    trip.setServiceId(aid("serviceId"));

    TripEntryImpl tripEntry = trip("trip");

    StopTime stA = new StopTime();
    stA.setId(100);
    stA.setArrivalTime(time(9, 00));
    stA.setDepartureTime(time(9, 05));
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.TripEntryImpl

    Trip trip = new Trip();
    trip.setRoute(route);
    trip.setServiceId(aid("serviceId"));

    TripEntryImpl tripEntry = trip("trip");

    StopTime stA = new StopTime();
    stA.setId(100);
    stA.setArrivalTime(time(9, 00));
    stA.setDepartureTime(time(9, 05));
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.TripEntryImpl

public class BlockTripInstanceLibraryTest {

  @Test
  public void test() {
    BlockEntryImpl block = UnitTestingSupport.block("block");
    TripEntryImpl tripA = UnitTestingSupport.trip("tripA");
    TripEntryImpl tripB = UnitTestingSupport.trip("tripB");
    UnitTestingSupport.stopTime(0, null, tripA, 0, 0);
    UnitTestingSupport.stopTime(0, null, tripB, 0, 0);
    ServiceIdActivation serviceIds = UnitTestingSupport.serviceIds("sid");
    BlockConfigurationEntry blockConfig = UnitTestingSupport.blockConfiguration(
        block, serviceIds, tripA, tripB);
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.TripEntryImpl

    Map<String, StopEntryImpl> stops = new HashMap<String, StopEntryImpl>();

    int index = 0;

    TripEntryImpl trip = UnitTestingSupport.trip("trip");
    List<StopTimeEntryImpl> stopTimes = new ArrayList<StopTimeEntryImpl>();

    while ((line = reader.readLine()) != null) {
      String[] tokens = line.split(" ");
      String stopId = tokens[0];
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.TripEntryImpl

      for (Trip trip : tripsForRoute) {
        tripIndex++;
        if (tripIndex % 500 == 0)
          _log.info("trips processed: " + tripIndex + "/"
              + tripsForRoute.size());
        TripEntryImpl tripEntry = processTrip(graph, trip);
        if (tripEntry != null) {
          tripEntry.setRoute(routeEntry);
          tripEntries.add(tripEntry);
        }
      }

      tripEntries.trimToSize();
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.TripEntryImpl

    Agency agency = trip.getRoute().getAgency();
    TimeZone tz = TimeZone.getTimeZone(agency.getTimezone());
    LocalizedServiceId lsid = new LocalizedServiceId(trip.getServiceId(), tz);

    TripEntryImpl tripEntry = new TripEntryImpl();

    tripEntry.setId(trip.getId());
    tripEntry.setDirectionId(unique(trip.getDirectionId()));
    tripEntry.setServiceId(unique(lsid));

    // Only set the shape id for a trip if there are actually shape points to
    // back it up
    if (!(shapePoints == null || shapePoints.isEmpty()))
      tripEntry.setShapeId(unique(trip.getShapeId()));

    List<StopTimeEntryImpl> stopTimesForTrip = _stopTimeEntriesFactory.processStopTimes(
        graph, stopTimes, tripEntry, shapePoints);

    double tripDistance = getTripDistance(stopTimesForTrip, shapePoints);
    tripEntry.setTotalTripDistance(tripDistance);

    tripEntry.setStopTimes(cast(stopTimesForTrip));

    graph.putTripEntry(tripEntry);

    return tripEntry;
  }
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.TripEntryImpl

    Map<String, StopEntryImpl> stops = new HashMap<String, StopEntryImpl>();

    int index = 0;

    TripEntryImpl trip = UnitTestingSupport.trip("trip");
    List<StopTimeEntryImpl> stopTimes = new ArrayList<StopTimeEntryImpl>();

    while ((line = reader.readLine()) != null) {
      String[] tokens = line.split(" ");
      String stopId = tokens[0];
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.