Package org.onebusaway.transit_data_federation.impl.transit_graph

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


      List<Trip> trips = _gtfsDao.getTripsForRoute(route);

      for (Trip trip : trips) {

        TripEntryImpl tripEntry = graph.getTripEntryForId(trip.getId());

        // If null, probably indicates no stop times, or some other reason to
        // prune the trip
        if (tripEntry == null)
          continue;
View Full Code Here


  @Test
  public void testSimpleOperations() {
    long serviceDate = System.currentTimeMillis();

    BlockEntryImpl block = block("blockA");
    TripEntryImpl trip = trip("tripA", "serviceId");
    stopTime(0, null, trip, time(9, 00), 0);
    BlockConfigurationEntry blockConfig = linkBlockTrips(block, trip);
    BlockInstance blockInstance = new BlockInstance(blockConfig, serviceDate);

    VehicleLocationRecordCacheImpl cache = new VehicleLocationRecordCacheImpl();
View Full Code Here

  public void testClearCache() throws InterruptedException {

    long serviceDate = System.currentTimeMillis();

    BlockEntryImpl blockA = block("blockA");
    TripEntryImpl tripA = trip("tripA", "serviceId");
    stopTime(0, null, tripA, time(9, 00), 0);
    BlockConfigurationEntry blockConfigA = linkBlockTrips(blockA, tripA);
    BlockInstance instanceA = new BlockInstance(blockConfigA, serviceDate);

    BlockEntryImpl blockB = block("blockB");
    TripEntryImpl tripB = trip("tripB", "serviceId");
    stopTime(0, null, tripB, time(9, 00), 0);
    BlockConfigurationEntry blockConfigB = linkBlockTrips(blockB, tripB);
    BlockInstance instanceB = new BlockInstance(blockConfigB, serviceDate);

    VehicleLocationRecordCacheImpl cache = new VehicleLocationRecordCacheImpl();
View Full Code Here

    int vid = 0;

    for (int i = 0; i < 20; i++) {

      BlockEntryImpl block = block(Integer.toString(i));
      TripEntryImpl trip = trip(Integer.toString(i), "serviceId");
      stopTime(0, null, trip, time(9, 00), 0);
      BlockConfigurationEntry blockConfig = linkBlockTrips(block, trip);
      BlockInstance blockInstance = new BlockInstance(blockConfig, serviceDate);

      for (int j = 0; j < 5; j++) {
View Full Code Here

  @Test
  public void testSimpleOperations() {
    long serviceDate = System.currentTimeMillis();

    BlockEntryImpl block = block("blockA");
    TripEntryImpl trip = trip("tripA", "serviceId");
    stopTime(0, null, trip, time(9, 00), 0);
    BlockConfigurationEntry blockConfig = linkBlockTrips(block, trip);
    BlockInstance blockInstance = new BlockInstance(blockConfig, serviceDate);

    BlockLocationRecordCacheImpl cache = new BlockLocationRecordCacheImpl();
View Full Code Here

  public void testClearCache() throws InterruptedException {

    long serviceDate = System.currentTimeMillis();

    BlockEntryImpl blockA = block("blockA");
    TripEntryImpl tripA = trip("tripA", "serviceId");
    stopTime(0, null, tripA, time(9, 00), 0);
    BlockConfigurationEntry blockConfigA = linkBlockTrips(blockA, tripA);
    BlockInstance instanceA = new BlockInstance(blockConfigA, serviceDate);

    BlockEntryImpl blockB = block("blockB");
    TripEntryImpl tripB = trip("tripB", "serviceId");
    stopTime(0, null, tripB, time(9, 00), 0);
    BlockConfigurationEntry blockConfigB = linkBlockTrips(blockB, tripB);
    BlockInstance instanceB = new BlockInstance(blockConfigB, serviceDate);

    BlockLocationRecordCacheImpl cache = new BlockLocationRecordCacheImpl();
View Full Code Here

    int vid = 0;

    for (int i = 0; i < 20; i++) {

      BlockEntryImpl block = block(Integer.toString(i));
      TripEntryImpl trip = trip(Integer.toString(i), "serviceId");
      stopTime(0, null, trip, time(9, 00), 0);
      BlockConfigurationEntry blockConfig = linkBlockTrips(block, trip);
      BlockInstance blockInstance = new BlockInstance(blockConfig, serviceDate);

      for (int j = 0; j < 5; j++) {
View Full Code Here

    StopEntry stopB = stop("stopB", 47.67, -122.30);

    Mockito.when(transitGraphDao.getAllStops()).thenReturn(
        Arrays.asList(stopA, stopB));

    TripEntryImpl tripA = trip("tripA");
    AgencyAndId shapeIdA = aid("shapeA");
    tripA.setShapeId(shapeIdA);
    TripEntryImpl tripB = trip("tripB");
    AgencyAndId shapeIdB = aid("shapeB");
    tripB.setShapeId(shapeIdB);

    Mockito.when(transitGraphDao.getAllTrips()).thenReturn(
        Arrays.asList((TripEntry) tripA, tripB));

    ShapePointsFactory factory = new ShapePointsFactory();
View Full Code Here

     * Block A
     ****/

    BlockEntryImpl blockA = block("a");

    TripEntryImpl tripA1 = trip("a1", "s1"); // 1
    TripEntryImpl tripA2 = trip("a2", "s1");
    TripEntryImpl tripA3 = trip("a3", "s1");

    stopTime(0, stopA, tripA1, 0, 10, 0);
    stopTime(0, stopB, tripA1, 20, 20, 0);
    stopTime(0, stopC, tripA2, 30, 30, 0);
    stopTime(0, stopA, tripA2, 40, 40, 0);
    stopTime(0, stopA, tripA3, 50, 50, 0);
    stopTime(0, stopB, tripA3, 60, 70, 0);

    linkBlockTrips(blockA, tripA1, tripA2, tripA3);

    /****
     * Block B - Same trip/stop sequence as A
     ****/

    BlockEntryImpl blockB = block("b");

    TripEntryImpl tripB1 = trip("b1", "s1");
    TripEntryImpl tripB2 = trip("b2", "s1");
    TripEntryImpl tripB3 = trip("b3", "s1");

    stopTime(0, stopA, tripB1, 20, 30, 0);
    stopTime(0, stopB, tripB1, 50, 50, 0);
    stopTime(0, stopC, tripB2, 60, 60, 0);
    stopTime(0, stopA, tripB2, 70, 70, 0);
    stopTime(0, stopA, tripB3, 80, 80, 0);
    stopTime(0, stopB, tripB3, 90, 100, 0);

    linkBlockTrips(blockB, tripB1, tripB2, tripB3);

    /****
     * Block C - Same stop sequence, but runs a little bit faster
     ****/

    BlockEntryImpl blockC = block("c");

    TripEntryImpl tripC1 = trip("c1", "s1");
    TripEntryImpl tripC2 = trip("c2", "s1");
    TripEntryImpl tripC3 = trip("c3", "s1");

    stopTime(0, stopA, tripC1, 40, 50, 0);
    stopTime(0, stopB, tripC1, 60, 60, 0);
    stopTime(0, stopC, tripC2, 70, 70, 0);
    stopTime(0, stopA, tripC2, 80, 80, 0);
    stopTime(0, stopA, tripC3, 85, 85, 0);
    stopTime(0, stopB, tripC3, 90, 95, 0);

    linkBlockTrips(blockC, tripC1, tripC2, tripC3);

    /****
     * Block D - Same stop sequence, but with different service id
     ****/

    BlockEntryImpl blockD = block("d");

    TripEntryImpl tripD1 = trip("d1", "s1");
    TripEntryImpl tripD2 = trip("d2", "s1");
    TripEntryImpl tripD3 = trip("d3", "s2");

    stopTime(0, stopA, tripD1, 40, 50, 0);
    stopTime(0, stopB, tripD1, 70, 70, 0);
    stopTime(0, stopC, tripD2, 80, 80, 0);
    stopTime(0, stopA, tripD2, 90, 90, 0);
    stopTime(0, stopA, tripD3, 100, 100, 0);
    stopTime(0, stopB, tripD3, 110, 120, 0);

    linkBlockTrips(blockD, tripD1, tripD2, tripD3);

    /****
     * Block E - One less stop
     ****/

    BlockEntryImpl blockE = block("e");

    TripEntryImpl tripE1 = trip("e1", "s1");
    TripEntryImpl tripE2 = trip("e2", "s1");
    TripEntryImpl tripE3 = trip("e3", "s1");

    stopTime(0, stopA, tripE1, 50, 60, 0);
    stopTime(0, stopB, tripE1, 80, 80, 0);
    stopTime(0, stopC, tripE2, 90, 90, 0);
    stopTime(0, stopA, tripE2, 100, 100, 0);
    stopTime(0, stopA, tripE3, 110, 110, 0);

    linkBlockTrips(blockE, tripE1, tripE2, tripE3);

    /****
     * Block F - Another to group with E, but earlier
     ****/

    BlockEntryImpl blockF = block("f");

    TripEntryImpl tripF1 = trip("f1", "s1");
    TripEntryImpl tripF2 = trip("f2", "s1");
    TripEntryImpl tripF3 = trip("f3", "s1");

    stopTime(0, stopA, tripF1, 40, 50, 0);
    stopTime(0, stopB, tripF1, 70, 70, 0);
    stopTime(0, stopC, tripF2, 80, 80, 0);
    stopTime(0, stopA, tripF2, 90, 90, 0);
View Full Code Here

     * Block A
     ****/

    BlockEntryImpl blockA = block("a");

    TripEntryImpl tripA = trip("a", "s1");

    stopTime(0, stopA, tripA, 0, 10, 0);
    stopTime(0, stopB, tripA, 20, 20, 0);

    FrequencyEntry freqA1 = frequency(time(6, 00), time(9, 00), 10);
    FrequencyEntry freqA2 = frequency(time(15, 00), time(18, 00), 10);
    List<FrequencyEntry> freqsA = Arrays.asList(freqA1, freqA2);

    linkBlockTrips(blockA, freqsA, tripA);

    /****
     * Block B
     ****/

    BlockEntryImpl blockB = block("b");

    TripEntryImpl tripB = trip("b", "s1");

    stopTime(0, stopA, tripB, 20, 30, 0);
    stopTime(0, stopB, tripB, 50, 50, 0);

    FrequencyEntry freqB1 = frequency(time(9, 00), time(15, 00), 20);
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.impl.transit_graph.TripEntryImpl

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.