Package org.onebusaway.transit_data_federation.services.tripplanner

Examples of org.onebusaway.transit_data_federation.services.tripplanner.StopTimeInstance


   * {@link HasEdges} Interface
   ****/

  @Override
  public Collection<Edge> getOutgoing() {
    StopTimeInstance next = _instance.getNextStopTimeInstance();
    if (next == null)
      return Collections.emptyList();
    return Arrays.asList((Edge) new TPOfflineBlockHopEdge(_context, _instance,
        next));
  }
View Full Code Here


        System.out.println("      instances=" + instances.size());

        if (instances.isEmpty())
          continue;

        StopTimeInstance first = instances.get(0);
        long tFrom = first.getDepartureTime();

        Map<StopEntry, List<StopTimeInstance>> nearbyStopTimeInstances = getNearbyStopTimeInstances(
            nearbyStopsAndWalkTimes.keySet(), serviceDate);

        OBATraverseOptions options = _otpConfigurationService.createTraverseOptions();
View Full Code Here

      /**
       * We prune any arrivals that loop back to the origin stop
       */
      if (vertex instanceof TPOfflineBlockArrivalVertex) {
        TPOfflineBlockArrivalVertex bav = (TPOfflineBlockArrivalVertex) vertex;
        StopTimeInstance instance = bav.getInstance();
        if (instance.getStop() == _originStop)
          return true;
      }

      /**
       * Skip a vertex that has moved on to the next service date
       */
      if (vertex instanceof HasStopTimeInstanceTransitVertex) {
        HasStopTimeInstanceTransitVertex v = (HasStopTimeInstanceTransitVertex) vertex;
        StopTimeInstance instance = v.getInstance();
        if (instance.getServiceDate() > _serviceDate + 12 * 60 * 60 * 1000)
          return true;
      }

      /**
       * Print the visited stop count as a show of progress
View Full Code Here

    sort(results);

    assertEquals(2, results.size());

    StopTimeInstance sti = results.get(0);
    assertEquals(day.getTime(), sti.getServiceDate());
    assertEquals(dateAsLong("2009-09-01 10:10"), sti.getArrivalTime());
    assertEquals(dateAsLong("2009-09-01 10:10"), sti.getDepartureTime());

    sti = results.get(1);
    assertEquals(day.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-01 10:20").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-01 10:20").getTime(), sti.getDepartureTime());

    from = date("2009-09-01 10:15");
    to = date("2009-09-01 10:25");

    results = _service.getStopTimeInstancesInTimeRange(_stopId, from, to);

    sort(results);

    assertEquals(1, results.size());

    sti = results.get(0);
    assertEquals(day.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-01 10:20").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-01 10:20").getTime(), sti.getDepartureTime());

    from = date("2009-09-01 10:21");
    to = date("2009-09-01 10:25");

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

    super(sti, false);
  }

  @Override
  public String toString() {
    StopTimeInstance sti = getStopTimeInstance();
    return "departure(ts=" + getCurrentTimeString() + " stop=" + sti.getStop().getId() + " trip="
        + getStopTimeInstance().getTrip() + ")";
  }
View Full Code Here

    sort(results);

    assertEquals(1, results.size());

    StopTimeInstance sti = results.get(0);
    assertEquals(dayA.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-01 10:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-01 10:30").getTime(), sti.getDepartureTime());

    /****
     *
     ****/

    from = date("2009-09-02 10:10");
    to = date("2009-09-02 10:40");
    results = _service.getStopTimeInstancesInTimeRange(_stopId, from, to);

    sort(results);

    assertEquals(1, results.size());

    sti = results.get(0);
    assertEquals(dayB.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-02 10:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-02 10:30").getTime(), sti.getDepartureTime());

    /****
     *
     ****/

    from = date("2009-09-01 10:10");
    to = date("2009-09-02 10:40");
    results = _service.getStopTimeInstancesInTimeRange(_stopId, from, to);

    sort(results);

    assertEquals(3, results.size());

    sti = results.get(0);
    assertEquals(dayA.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-01 10:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-01 10:30").getTime(), sti.getDepartureTime());

    sti = results.get(1);
    assertEquals(dayA.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-02 01:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-02 01:30").getTime(), sti.getDepartureTime());

    sti = results.get(2);
    assertEquals(dayB.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-02 10:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-02 10:30").getTime(), sti.getDepartureTime());

    /****
     *
     ****/

    from = date("2009-09-01 12:00");
    to = date("2009-09-02 12:00");
    results = _service.getStopTimeInstancesInTimeRange(_stopId, from, to);

    sort(results);

    assertEquals(2, results.size());

    sti = results.get(0);
    assertEquals(dayA.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-02 01:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-02 01:30").getTime(), sti.getDepartureTime());

    sti = results.get(1);
    assertEquals(dayB.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-02 10:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-02 10:30").getTime(), sti.getDepartureTime());

    /****
     *
     ****/

    from = date("2009-09-02 12:00");
    to = date("2009-09-03 12:00");
    results = _service.getStopTimeInstancesInTimeRange(_stopId, from, to);

    sort(results);

    assertEquals(1, results.size());

    sti = results.get(0);
    assertEquals(dayB.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-03 01:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-03 01:30").getTime(), sti.getDepartureTime());
  }
View Full Code Here

    sort(results);

    assertEquals(1, results.size());

    StopTimeInstance sti = results.get(0);
    assertEquals(dayA.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-02 10:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-02 10:30").getTime(), sti.getDepartureTime());

    /****
     *
     ****/

    from = date("2009-09-03 10:10");
    to = date("2009-09-03 10:40");
    results = _service.getStopTimeInstancesInTimeRange(_stopId, from, to);

    sort(results);

    assertEquals(1, results.size());

    sti = results.get(0);
    assertEquals(dayB.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-03 10:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-03 10:30").getTime(), sti.getDepartureTime());

    /****
     *
     ****/

    from = date("2009-09-02 10:10");
    to = date("2009-09-03 10:40");
    results = _service.getStopTimeInstancesInTimeRange(_stopId, from, to);

    sort(results);

    assertEquals(3, results.size());

    sti = results.get(0);
    assertEquals(dayA.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-02 10:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-02 10:30").getTime(), sti.getDepartureTime());

    sti = results.get(1);
    assertEquals(dayA.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-03 01:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-03 01:30").getTime(), sti.getDepartureTime());

    sti = results.get(2);
    assertEquals(dayB.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-03 10:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-03 10:30").getTime(), sti.getDepartureTime());

    /****
     *
     ****/

    from = date("2009-09-02 12:00");
    to = date("2009-09-03 12:00");
    results = _service.getStopTimeInstancesInTimeRange(_stopId, from, to);

    sort(results);

    assertEquals(2, results.size());

    sti = results.get(0);
    assertEquals(dayA.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-03 01:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-03 01:30").getTime(), sti.getDepartureTime());

    sti = results.get(1);
    assertEquals(dayB.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-03 10:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-03 10:30").getTime(), sti.getDepartureTime());

    /****
     *
     ****/

    from = date("2009-09-03 12:00");
    to = date("2009-09-04 12:00");
    results = _service.getStopTimeInstancesInTimeRange(_stopId, from, to);

    sort(results);

    assertEquals(1, results.size());

    sti = results.get(0);
    assertEquals(dayB.getTime(), sti.getServiceDate());
    assertEquals(date("2009-09-04 01:00").getTime(), sti.getArrivalTime());
    assertEquals(date("2009-09-04 01:30").getTime(), sti.getDepartureTime());
  }
View Full Code Here

    super(sti,true);
  }

  @Override
  public String toString() {
    StopTimeInstance sti = getStopTimeInstance();
    return "arrival(ts=" + getCurrentTimeString() + " stop="
        + sti.getStop().getId() + ")";
  }
View Full Code Here

        query.setTime(record.getTime());

        ArrivalAndDepartureInstance instance = _arrivalAndDepartureService.getArrivalAndDepartureForStop(query);

        if (instance != null) {
          StopTimeInstance sti = instance.getStopTimeInstance();
          StopTimeInstanceBean stopTimeBean = _stopTimeBeanService.getStopTimeInstanceAsBean(sti);
          bean.setStopTime(stopTimeBean);
        }
      }
    }
View Full Code Here

      scheduledTime.setArrivalTime(scheduledArrivalTime);
      scheduledTime.setDepartureTime(scheduledDepartureTime);
    }

    StopTimeInstance prevStopTimeInstance = new StopTimeInstance(prevStopTime,
        state);
    ArrivalAndDepartureInstance prevInstance = new ArrivalAndDepartureInstance(
        prevStopTimeInstance, scheduledTime);

    if (instance.isPredictedArrivalTimeSet()) {
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.services.tripplanner.StopTimeInstance

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.