Examples of TargetTime


Examples of org.onebusaway.transit_data_federation.model.TargetTime

    Vertex toV = new TPArrivalVertex(_context, _pathState);

    Pair<StopEntry> stopPair = _pathState.getStops();

    TargetTime targetTime = new TargetTime(s0.getTime(), obaOpts.currentTime);

    ArrivalAndDeparturePairQuery query = new ArrivalAndDeparturePairQuery();
    query.setResultCount(obaOpts.numItineraries);
    query.setApplyRealTime(obaOpts.useRealtime);
    query.setIncludePrivateService(false);
View Full Code Here

Examples of org.onebusaway.transit_data_federation.model.TargetTime

    Vertex fromV = new TPDepartureVertex(_context, _pathState);

    Pair<StopEntry> stopPair = _pathState.getStops();

    TargetTime targetTime = new TargetTime(s0.getTime(), obaOpts.currentTime);

    ArrivalAndDeparturePairQuery query = new ArrivalAndDeparturePairQuery();
    query.setResultCount(obaOpts.numItineraries);
    query.setApplyRealTime(obaOpts.useRealtime);
    query.setIncludePrivateService(false);
View Full Code Here

Examples of org.onebusaway.transit_data_federation.model.TargetTime

    Map<AgencyAndId, List<BlockLocation>> locationsByVehicleId = new FactoryMap<AgencyAndId, List<BlockLocation>>(
        new ArrayList<BlockLocation>());

    for (Date time : times) {
      TargetTime tt = new TargetTime(time.getTime(), currentTime);
      List<VehicleLocationCacheElements> records = getBlockLocationRecordCollectionForBlock(
          blockInstance, tt);
      for (VehicleLocationCacheElements cacheRecord : records) {
        BlockLocation location = getBlockLocation(blockInstance, cacheRecord,
            null, time.getTime());
View Full Code Here

Examples of org.onebusaway.transit_data_federation.model.TargetTime

    Record record = records.get(records.size() - 1);

    AgencyAndId vehicleId = AgencyAndIdLibrary.convertFromString(query.getVehicleId());
    BlockLocation location = _blockLocationService.getLocationForVehicleAndTime(
        vehicleId, new TargetTime(record.getTimestamp()));

    if (location == null)
      return false;

    double d = SphericalGeometryLibrary.distance(record.getLocation(),
View Full Code Here

Examples of org.onebusaway.transit_data_federation.model.TargetTime

    StopTimeInstance sti2 = new StopTimeInstance(bstBB, blockInstanceB.getState());
    ArrivalAndDepartureInstance in2 = new ArrivalAndDepartureInstance(sti2);
    in2.setBlockLocation(blockLocationB);

    TargetTime target = new TargetTime(t, t);

    Mockito.when(
        _arrivalAndDepartureService.getArrivalsAndDeparturesForStopInTimeRange(
            stopB, target, stopTimeFrom, stopTimeTo)).thenReturn(
        Arrays.asList(in1, in2));
View Full Code Here

Examples of org.onebusaway.transit_data_federation.model.TargetTime

    long serviceDate = 1000 * 1000;

    double epsilon = 0.001;

    TargetTime target = new TargetTime(t(
        serviceDate, 0, 0), System.currentTimeMillis());

    BlockInstance blockInstance = new BlockInstance(blockConfig, serviceDate);
    BlockLocation location = _service.getLocationForBlockInstance(
        blockInstance, target);

    assertNull(location);

    ScheduledBlockLocation p = new ScheduledBlockLocation();
    p.setActiveTrip(blockConfig.getTrips().get(0));
    p.setClosestStop(blockConfig.getStopTimes().get(0));
    p.setClosestStopTimeOffset(0);
    p.setDistanceAlongBlock(0);
    p.setLocation(new CoordinatePoint(stopA.getStopLat(), stopA.getStopLon()));
    p.setInService(true);

    Mockito.when(
        _blockLocationService.getScheduledBlockLocationFromScheduledTime(
            blockConfig, 1800)).thenReturn(p);

    target = new TargetTime(t(serviceDate, 0, 30), System.currentTimeMillis());

    location = _service.getLocationForBlockInstance(blockInstance, target);

    assertTrue(location.isInService());
    assertEquals(blockConfig.getStopTimes().get(0), location.getClosestStop());
View Full Code Here

Examples of org.onebusaway.transit_data_federation.model.TargetTime

  @Override
  public VehicleLocationRecordBean getVehicleLocationRecordForVehicleId(
      AgencyAndId vehicleId, long targetTime) {

    TargetTime target = new TargetTime(targetTime, targetTime);

    BlockLocation blockLocation = _blockLocationService.getLocationForVehicleAndTime(
        vehicleId, target);
    if (blockLocation == null)
      return null;
View Full Code Here

Examples of org.onebusaway.transit_data_federation.model.TargetTime

    long frequencyFromTime = time - query.getFrequencyMinutesBefore() * 60
        * 1000;
    long frequencyToTime = time + query.getFrequencyMinutesAfter() * 60 * 1000;

    TargetTime target = new TargetTime(time, time);

    List<ArrivalAndDepartureInstance> instances = _arrivalAndDepartureService.getArrivalsAndDeparturesForStopInTimeRange(
        stop, target, fromTime, toTime);

    List<ArrivalAndDepartureBean> beans = new ArrayList<ArrivalAndDepartureBean>();
View Full Code Here

Examples of org.onebusaway.transit_data_federation.model.TargetTime

    if (useRealTime) {
      /**
       * TODO : If we want to simulate real-time trip planning with the system
       * in some past state, we'll need a way to adjust NOW here
       */
      TargetTime target = new TargetTime(time, System.currentTimeMillis());
      return service.getArrivalsAndDeparturesForStopInTimeRange(_stop, target,
          timeFrom, timeTo);
    } else {
      return service.getScheduledArrivalsAndDeparturesForStopInTimeRange(_stop,
          time, timeFrom, timeTo);
View Full Code Here

Examples of org.onebusaway.transit_data_federation.model.TargetTime

    if (useRealtime) {
      /**
       * TODO : If we want to simulate real-time trip planning with the system
       * in some past state, we'll need a way to adjust NOW here
       */
      TargetTime time = new TargetTime(s0.getTime(), System.currentTimeMillis());
      return service.getArrivalsAndDeparturesForStopInTimeRange(_stop, time,
          fromTime, toTime);
    } else {
      return service.getScheduledArrivalsAndDeparturesForStopInTimeRange(_stop,
          s0.getTime(), fromTime, toTime);
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.