Package org.onebusaway.transit_data_federation.services.transit_graph

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


    // Store all the transfers
    for (Map.Entry<Pair<StopEntry>, Transfer> entry : activeTransfers.entrySet()) {
      Pair<StopEntry> transfer = entry.getKey();
      Transfer t = entry.getValue();
      double distance = t.getWalkingDistance();
      StopEntry fromStop = transfer.getFirst();
      StopEntry toStop = transfer.getSecond();

      StopTransferData stopTransfer = new StopTransferData(toStop.getId(), 0,
          distance);
      stopTransfersBySourceStop.get(fromStop.getId()).add(stopTransfer);
    }

    return stopTransfersBySourceStop;
View Full Code Here


  private void findNewStopAlongTrip(StopSequenceKey outboundSequence,
      StopSequenceStats stats, int fromIndex, Set<StopEntry> alreadySeen,
      Map<StopEntry, Map<StopEntry, Integer>> potentialTransfersWithTravelTimes) {

    List<StopEntry> outboundStops = outboundSequence.getStops();
    StopEntry fromStop = outboundStops.get(fromIndex);

    int toIndex = fromIndex;

    while (toIndex < outboundStops.size()) {

      StopEntry toNewStopEntry = outboundStops.get(toIndex);

      if (!alreadySeen.contains(toNewStopEntry)) {

        int time = stats.getTimeFromStart(toIndex)
            - stats.getTimeFromStart(fromIndex);
View Full Code Here

    Map<Pair<Stop>, Min<Transfer>> minsByTransferPoint = new FactoryMap<Pair<Stop>, Min<Transfer>>(
        new Min<Transfer>());

    for (Map.Entry<StopEntry, Integer> entry : potentialTransferEndPointsWithTravelTimes.entrySet()) {

      StopEntry transferToEntry = entry.getKey();
      double busTimeSecondTrip = entry.getValue() * 1000;

      for (StopEntry transferFromEntry : potentialTransferStartPointsByEndPoint.get(transferToEntry)) {

        Pair<StopEntry> pair = Tuples.pair(transferFromEntry, transferToEntry);
View Full Code Here

            StopTimeEntry from = prevBlockStopTime.getStopTime();
            StopTimeEntry to = blockStopTime.getStopTime();
            int time = to.getArrivalTime() - from.getDepartureTime();

            StopEntry stopFrom = from.getStop();
            StopEntry stopTo = to.getStop();

            Pair<StopEntry> stopPair = Tuples.pair(stopFrom, stopTo);

            Integer prevTime = minTravelTimes.get(stopPair);
            if (prevTime == null || time < prevTime)
View Full Code Here

    BufferedReader reader = openFile(path);
    String line = null;

    List<Record> records = new ArrayList<Record>();

    StopEntry originStop = null;
    boolean isOriginHubStop = false;

    while ((line = reader.readLine()) != null) {

      if (_lines % 1000000 == 0)
        _log.info("lines=" + _lines);

      if (line.length() == 0)
        continue;

      List<String> tokens = CSVLibrary.parse(line);

      AgencyAndId stopId = AgencyAndIdLibrary.convertFromString(tokens.get(1));
      StopEntry stop = _dao.getStopEntryForId(stopId, true);
      short stopIndex = _indices.get(stop);

      String key = tokens.get(0);
      ERecordType type = getRecordTypeForValue(tokens.get(2));
View Full Code Here

    _totalHits++;

    if (!_cache.containsKey(pair)) {

      StopEntry from = pair.getFirst();
      StopEntry to = pair.getSecond();

      String fromPlace = from.getStopLat() + "," + from.getStopLon();
      String toPlace = to.getStopLat() + "," + to.getStopLon();
      Date targetTime = new Date();

      TraverseOptions options = new TraverseOptions();
      options.optimizeFor = OptimizeType.WALK;
      options.setModes(new TraverseModeSet(TraverseMode.WALK));
View Full Code Here

      return;

    Entry node = _root;

    for (Pair<StopEntry> segment : path) {
      StopEntry from = segment.getFirst();
      StopEntry to = segment.getSecond();

      if (node == _root) {
        if (from != _root.stop)
          throw new IllegalStateException();
      } else {
        node = node.extend(from);
      }

      node = node.extend(to);
    }

    StopEntry stop = node.stop;
    Set<Entry> nodes = _stops.get(stop);
    if (nodes == null) {
      nodes = new HashSet<Entry>();
      _stops.put(stop, nodes);
    }
View Full Code Here

     * We can't ignore the fact that it might be faster to just walk to a
     * different stop (like across the street)
     */
    for (Map.Entry<StopEntry, Integer> entry : _nearbyStopsAndWalkTimes.entrySet()) {

      StopEntry nearbyStop = entry.getKey();
      int walkTime = entry.getValue();

      List<StopTimeInstance> instances = _nearbyStopTimeInstances.get(nearbyStop);

      if (instances.isEmpty())
View Full Code Here

    return _instance.getStop();
  }

  @Override
  public AgencyAndId getStopId() {
    StopEntry stop = _instance.getStop();
    return stop.getId();
  }
View Full Code Here

  @Override
  public Collection<Edge> getOutgoing() {

    List<Edge> edges = new ArrayList<Edge>();
    StopEntry stop = _instance.getStop();

    /**
     * We can continue on our current route if applicable
     */
    if (_instance.getStopTime().hasNextStop()) {
View Full Code Here

TOP

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

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.