Package org.onebusaway.transit_data_federation.impl.transit_graph

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


    Date from = date("2009-09-01 10:00");
    Date to = date("2009-09-01 10:30");
    Date day = getTimeAsDay(from);

    StopTimeEntryImpl stA = stopTime(0, _stop, trip("A", "sA"), time(9, 50), 0);
    StopTimeEntryImpl stB = stopTime(1, _stop, trip("B", "sA"), time(10, 10), 0);
    StopTimeEntryImpl stC = stopTime(2, _stop, trip("C", "sA"), time(10, 20), 0);
    StopTimeEntryImpl stD = stopTime(3, _stop, trip("D", "sA"), time(10, 40), 0);

    BlockConfigurationEntry bA = linkBlockTrips("bA", stA.getTrip());
    BlockConfigurationEntry bB = linkBlockTrips("bB", stB.getTrip());
    BlockConfigurationEntry bC = linkBlockTrips("bC", stC.getTrip());
    BlockConfigurationEntry bD = linkBlockTrips("bD", stD.getTrip());

    addFirstStopToBlockIndex(bA, bB, bC, bD);

    List<StopTimeInstance> results = _service.getStopTimeInstancesInTimeRange(
        _stopId, from, to);
View Full Code Here


    Date dayA = getTimeAsDay(date("2009-09-01 00:00"));
    Date dayB = getTimeAsDay(date("2009-09-02 00:00"));

    // 10:00am, 10:30am
    StopTimeEntryImpl stA = stopTime(0, _stop, trip("A", "sA"), time(10, 00),
        time(10, 30), 0);

    // 01:00am, 01:30am (both on next day)
    StopTimeEntryImpl stB = stopTime(1, _stop, trip("B", "sA"), time(25, 00),
        time(25, 30), 0);

    BlockConfigurationEntry bA = linkBlockTrips("bA", stA.getTrip());
    BlockConfigurationEntry bB = linkBlockTrips("bB", stB.getTrip());

    addFirstStopToBlockIndex(bA, bB);

    /****
     *
 
View Full Code Here

  public void test03() {

    Date dayA = getTimeAsDay(date("2009-09-02 00:00"));
    Date dayB = getTimeAsDay(date("2009-09-03 00:00"));

    StopTimeEntryImpl stA = stopTime(0, _stop, trip("A", "sA"), time(10, 00),
        time(10, 30), 0);
    StopTimeEntryImpl stB = stopTime(1, _stop, trip("B", "sA"), time(25, 0),
        time(25, 30), 0);
    StopTimeEntryImpl stC = stopTime(2, _stop, trip("C", "sB"), time(10, 00),
        time(10, 30), 0);
    StopTimeEntryImpl stD = stopTime(3, _stop, trip("D", "sB"), time(25, 0),
        time(25, 30), 0);

    BlockConfigurationEntry bA = linkBlockTrips("bA", stA.getTrip());
    BlockConfigurationEntry bB = linkBlockTrips("bB", stB.getTrip());
    BlockConfigurationEntry bC = linkBlockTrips("bC", stC.getTrip());
    BlockConfigurationEntry bD = linkBlockTrips("bD", stD.getTrip());

    addFirstStopToBlockIndex(bA, bB);
    addFirstStopToBlockIndex(bC, bD);

    /****
 
View Full Code Here

    TripEntryImpl tripB = trip("tripB", 2000);
    TripEntryImpl tripC = trip("tripB", 1500);

    List<TripEntry> trips = Arrays.asList((TripEntry) tripA, tripB, tripC);

    StopTimeEntryImpl st1 = stopTime(1, stopA, tripA, time(6, 30), time(6, 35),
        200);
    StopTimeEntryImpl st2 = stopTime(2, stopB, tripA, time(7, 00), time(7, 10),
        800);

    StopTimeEntryImpl st3 = stopTime(3, stopB, tripB, time(7, 30), time(7, 35),
        400);
    StopTimeEntryImpl st4 = stopTime(4, stopA, tripB, time(8, 00), time(8, 07),
        1600);

    StopTimeEntryImpl st5 = stopTime(5, stopA, tripC, time(8, 30), time(8, 35),
        300);
    StopTimeEntryImpl st6 = stopTime(6, stopB, tripC, time(9, 00), time(9, 02),
        1200);

    Builder builder = BlockConfigurationEntryImpl.builder();
    builder.setBlock(block);
    builder.setTrips(trips);
View Full Code Here

    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);

    /****
     * Actual Test
     ****/
 
View Full Code Here

    List<StopTimeEntryImpl> entries = factory.processStopTimes(graph,
        stopTimes, tripEntry, shapePoints);

    assertEquals(stopTimes.size(), entries.size());

    StopTimeEntryImpl entry = entries.get(0);
    assertEquals(0, entry.getAccumulatedSlackTime());
    assertEquals(time(9, 00), entry.getArrivalTime());
    assertEquals(time(9, 05), entry.getDepartureTime());
    assertEquals(0, entry.getSequence());
    assertEquals(181.5, entry.getShapeDistTraveled(), 0.1);
    assertEquals(5 * 60, entry.getSlackTime());

    entry = entries.get(1);
    assertEquals(5 * 60, entry.getAccumulatedSlackTime());
    assertEquals(time(9, 28, 31), entry.getArrivalTime());
    assertEquals(time(9, 28, 31), entry.getDepartureTime());
    assertEquals(1, entry.getSequence());
    assertEquals(738.7, entry.getShapeDistTraveled(), 0.1);
    assertEquals(0, entry.getSlackTime());

    entry = entries.get(2);
    assertEquals(5 * 60, entry.getAccumulatedSlackTime());
    assertEquals(time(10, 00), entry.getArrivalTime());
    assertEquals(time(10, 05), entry.getDepartureTime());
    assertEquals(2, entry.getSequence());
    assertEquals(1484.5, entry.getShapeDistTraveled(), 0.1);
    assertEquals(5 * 60, entry.getSlackTime());
  }
View Full Code Here

    List<StopTimeEntryImpl> entries = factory.processStopTimes(graph,
        stopTimes, tripEntry, shapePoints);

    assertEquals(stopTimes.size(), entries.size());

    StopTimeEntryImpl entry = entries.get(0);
    assertEquals(0, entry.getAccumulatedSlackTime());
    assertEquals(time(9, 00), entry.getArrivalTime());
    assertEquals(time(9, 05), entry.getDepartureTime());
    assertEquals(0, entry.getSequence());
    assertEquals(181.5, entry.getShapeDistTraveled(), 0.1);
    assertEquals(5 * 60, entry.getSlackTime());

    entry = entries.get(1);
    assertEquals(5 * 60, entry.getAccumulatedSlackTime());
    assertEquals(time(9, 28, 45), entry.getArrivalTime());
    assertEquals(time(9, 28, 45), entry.getDepartureTime());
    assertEquals(1, entry.getSequence());
    assertEquals(738.7, entry.getShapeDistTraveled(), 0.1);
    assertEquals(0, entry.getSlackTime());

    entry = entries.get(2);
    assertEquals(5 * 60, entry.getAccumulatedSlackTime());
    assertEquals(time(10, 00, 34), entry.getArrivalTime());
    assertEquals(time(10, 00, 34), entry.getDepartureTime());
    assertEquals(2, entry.getSequence());
    assertEquals(1484.5, entry.getShapeDistTraveled(), 0.1);
    assertEquals(0, entry.getSlackTime());

    entry = entries.get(3);
    assertEquals(5 * 60, entry.getAccumulatedSlackTime());
    assertEquals(time(11, 00), entry.getArrivalTime());
    assertEquals(time(11, 05), entry.getDepartureTime());
    assertEquals(3, entry.getSequence());
    assertEquals(2877.69, entry.getShapeDistTraveled(), 0.1);
    assertEquals(60 * 5, entry.getSlackTime());

  }
View Full Code Here

    List<StopTimeEntryImpl> entries = factory.processStopTimes(graph,
        stopTimes, tripEntry, shapePoints);

    assertEquals(stopTimes.size(), entries.size());

    StopTimeEntryImpl entry = entries.get(0);
    assertEquals(0, entry.getAccumulatedSlackTime());
    assertEquals(time(9, 00), entry.getArrivalTime());
    assertEquals(time(9, 05), entry.getDepartureTime());
    assertEquals(0, entry.getSequence());
    assertEquals(181.5, entry.getShapeDistTraveled(), 0.1);
    assertEquals(5 * 60, entry.getSlackTime());

    entry = entries.get(1);
    assertEquals(5 * 60, entry.getAccumulatedSlackTime());
    assertEquals(time(9, 28, 31), entry.getArrivalTime());
    assertEquals(time(9, 28, 31), entry.getDepartureTime());
    assertEquals(1, entry.getSequence());
    assertEquals(738.7, entry.getShapeDistTraveled(), 0.1);
    assertEquals(0, entry.getSlackTime());

    entry = entries.get(2);
    assertEquals(5 * 60, entry.getAccumulatedSlackTime());
    assertEquals(time(10, 00), entry.getArrivalTime());
    assertEquals(time(10, 05), entry.getDepartureTime());
    assertEquals(2, entry.getSequence());
    assertEquals(1484.5, entry.getShapeDistTraveled(), 0.1);
    assertEquals(5 * 60, entry.getSlackTime());
  }
View Full Code Here

      if (stop == null) {
        stop = UnitTestingSupport.stop(stopId, lat, lon);
        stops.put(stopId, stop);
      }

      StopTimeEntryImpl stopTime = UnitTestingSupport.stopTime(index, stop,
          trip, index, index, Double.NaN);
      stopTimes.add(stopTime);
    }

    reader.close();
View Full Code Here

      Stop stop = stopTime.getStop();
      AgencyAndId stopId = stop.getId();
      StopEntryImpl stopEntry = graph.getStopEntryForId(stopId);

      StopTimeEntryImpl stopTimeEntry = new StopTimeEntryImpl();

      stopTimeEntry.setId(stopTime.getId());
      stopTimeEntry.setSequence(sequence);
      stopTimeEntry.setDropOffType(stopTime.getDropOffType());
      stopTimeEntry.setPickupType(stopTime.getPickupType());
      stopTimeEntry.setStop(stopEntry);

      stopTimeEntries.add(stopTimeEntry);
      sequence++;
    }
View Full Code Here

TOP

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

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.