Package org.onebusaway.transit_data_federation.services.transit_graph

Examples of org.onebusaway.transit_data_federation.services.transit_graph.FrequencyBlockStopTimeEntry


        int fromIndex = GenericBinarySearch.search(index, index.size(),
            relativeFrom, IndexAdapters.FREQUENCY_END_TIME_INSTANCE);

        List<FrequencyBlockStopTimeEntry> frequencyStopTimes = index.getFrequencyStopTimes();
        if (fromIndex < index.size()) {
          FrequencyBlockStopTimeEntry entry = frequencyStopTimes.get(fromIndex);
          BlockStopTimeEntry bst = entry.getStopTime();
          FrequencyEntry frequency = entry.getFrequency();
          InstanceState state = new InstanceState(serviceDate.getTime(),
              frequency);
          int stopTimeOffset = entry.getStopTimeOffset();
          int frequencyOffset = computeFrequencyOffset(relativeFrom, bst,
              frequency, stopTimeOffset, true);
          StopTimeInstance sti = new StopTimeInstance(bst, state,
              frequencyOffset);
          stopTimeInstances.add(sti);
View Full Code Here


        if (!findDepartures)
          sourceIndex--;

        if (0 <= sourceIndex && sourceIndex < sourceStopIndex.size()) {

          FrequencyBlockStopTimeEntry sourceEntry = sourceStopTimes.get(sourceIndex);
          BlockStopTimeEntry sourceBst = sourceEntry.getStopTime();
          FrequencyEntry frequency = sourceEntry.getFrequency();
          InstanceState state = new InstanceState(serviceDate.getTime(),
              frequency);
          int stopTimeOffset = sourceEntry.getStopTimeOffset();

          int frequencyOffset = computeFrequencyOffset(relativeTime, sourceBst,
              frequency, stopTimeOffset, findDepartures);

          StopTimeInstance stiSource = new StopTimeInstance(sourceBst, state,
              frequencyOffset);

          FrequencyBlockStopTimeEntry toEntry = destStopTimes.get(sourceIndex);
          BlockStopTimeEntry stopTimeTo = toEntry.getStopTime();
          StopTimeInstance stiDest = new StopTimeInstance(stopTimeTo, state,
              frequencyOffset);

          /**
           * There's a chance the frequency-based departure+arrival pair could
View Full Code Here

    List<Integer> offsetsIntoIndex = new ArrayList<Integer>();

    for (int in = fromIndex; in < toIndex; in++) {

      FrequencyBlockStopTimeEntry entry = frequencyStopTimes.get(in);
      BlockStopTimeEntry bst = entry.getStopTime();
      FrequencyEntry frequency = entry.getFrequency();

      InstanceState state = new InstanceState(serviceDate.getTime(), frequency);

      switch (frequencyBehavior) {

        case INCLUDE_UNSPECIFIED: {
          stopTimeInstances.add(new StopTimeInstance(bst, state));
          offsetsIntoIndex.add(in);
          break;
        }
        case INCLUDE_INTERPOLATED: {

          int stopTimeOffset = entry.getStopTimeOffset();

          int tFrom = Math.max(relativeFrom, frequency.getStartTime());
          int tTo = Math.min(relativeTo, frequency.getEndTime());

          tFrom = snapToFrequencyStopTime(frequency, tFrom, stopTimeOffset,
View Full Code Here

    for (BlockStopTimeEntry blockStopTime : stopTimes) {
      BlockTripEntry trip = blockStopTime.getTrip();
      BlockConfigurationEntry blockConfig = trip.getBlockConfiguration();
      for (FrequencyEntry frequency : blockConfig.getFrequencies()) {
        FrequencyBlockStopTimeEntry frequencyStopTime = new FrequencyBlockStopTimeEntryImpl(
            blockStopTime, frequency);
        frequencyStopTimes.add(frequencyStopTime);
      }
    }
View Full Code Here

    int[] stopIndices = new int[n];

    ServiceInterval interval = null;

    for (int i = 0; i < n; i++) {
      FrequencyBlockStopTimeEntry frequencyBlockStopTime = group.get(i);
      FrequencyEntry frequency = frequencyBlockStopTime.getFrequency();
      frequencies.add(frequency);
      BlockStopTimeEntry blockStopTime = frequencyBlockStopTime.getStopTime();
      blockConfigs.add(blockStopTime.getTrip().getBlockConfiguration());
      stopIndices[i] = blockStopTime.getBlockSequence();
      interval = ServiceInterval.extend(interval, frequency.getStartTime(),
          frequency.getStartTime());
      interval = ServiceInterval.extend(interval, frequency.getEndTime(),
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.services.transit_graph.FrequencyBlockStopTimeEntry

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.