Package org.onebusaway.transit_data_federation.services.transit_graph

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


    if (transitLeg.getFromStop() != null
        && transitLeg.getFromStop().getId() != null) {

      AgencyAndId fromStopId = AgencyAndIdLibrary.convertFromString(transitLeg.getFromStop().getId());
      StopEntry fromStop = _transitGraphDao.getStopEntryForId(fromStopId, true);
      int fromStopSequence = transitLeg.getFromStopSequence();

      ArrivalAndDepartureQuery query = new ArrivalAndDepartureQuery();
      query.setStop(fromStop);
      query.setStopSequence(fromStopSequence);
      query.setTrip(trip);
      query.setServiceDate(serviceDate);
      query.setVehicleId(vehicleId);
      query.setTime(options.currentTime);

      ArrivalAndDepartureInstance instance = _arrivalAndDepartureService.getArrivalAndDepartureForStop(query);

      b.setFromStop(instance);
      b.setBlockTripInstanceFrom(instance.getBlockTripInstance());
      b.setScheduledDepartureTime(instance.getScheduledDepartureTime());
      b.setPredictedDepartureTime(instance.getPredictedDepartureTime());
    }

    if (transitLeg.getToStop() != null
        && transitLeg.getToStop().getId() != null) {

      AgencyAndId toStopId = AgencyAndIdLibrary.convertFromString(transitLeg.getToStop().getId());
      StopEntry toStop = _transitGraphDao.getStopEntryForId(toStopId, true);
      int toStopSequence = transitLeg.getToStopSequence();

      ArrivalAndDepartureQuery query = new ArrivalAndDepartureQuery();
      query.setStop(toStop);
      query.setStopSequence(toStopSequence);
View Full Code Here


        StreetTraversalPermission perms = sv.getPermission();
        if (perms != null)
          tags.put("access", perms.toString().toLowerCase());
      } else if (vertex instanceof AbstractStopVertex) {
        AbstractStopVertex stopVertex = (AbstractStopVertex) vertex;
        StopEntry stop = stopVertex.getStop();
        StopBean stopBean = _stopBeanService.getStopForId(stop.getId());
        tags.put("stop", stopBean);
      }

      bean.setTags(tags);
View Full Code Here

    int index = 0;
    String agencyId = null;

    for (Map.Entry<StopEntry, Long> entry : results.entrySet()) {
      StopEntry stop = entry.getKey();
      agencyId = stop.getId().getAgencyId();
      Long time = entry.getValue();
      stopIds[index] = ApplicationBeanLibrary.getId(stop.getId());
      lats[index] = stop.getStopLat();
      lons[index] = stop.getStopLon();
      times[index] = time;
      index++;
    }
    return new MinTravelTimeToStopsBean(agencyId, stopIds, lats, lons, times,
        walkingVelocity);
View Full Code Here

      while (sequence < maxBlockSequence) {

        blockStopTime = stopTimes.get(sequence);
        StopTimeEntry stopTime = blockStopTime.getStopTime();
        StopEntry stop = stopTime.getStop();

        double d = SphericalGeometryLibrary.distance(stop.getStopLat(),
            stop.getStopLon(), target.getY(), target.getX());

        double transitTime = Math.max(0, stopTime.getArrivalTime()
            - origStopTime.getDepartureTime());
        double walkingTime = d / _options.speed;
        minTime = Math.min(minTime, transitTime + walkingTime);
View Full Code Here

      Map<StopEntry, List<StopHop>> allHopsToStop) {

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

      Pair<StopEntry> pair = entry.getKey();
      StopEntry fromStop = pair.getFirst();
      StopEntry toStop = pair.getSecond();

      int minTravelTime = entry.getValue();

      /**
       * From Stop
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

    return _instance.getStop();
  }

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

    return stops.length;
  }

  @Override
  public StopTransfer get(int index) {
    StopEntry stop = stops[index];
    int minTravelTime = minTravelTimes[index];
    double distance = distances[index];
    return new StopTransfer(stop, minTravelTime, distance);
  }
View Full Code Here

  }

  private double computeDirectionOfTravel(List<BlockStopTimeEntry> bsts) {
    BlockStopTimeEntry fromBst = bsts.get(0);
    BlockStopTimeEntry toBst = bsts.get(bsts.size() - 1);
    StopEntry fromStop = fromBst.getStopTime().getStop();
    StopEntry toStop = toBst.getStopTime().getStop();
    return SphericalGeometryLibrary.getOrientation(fromStop.getStopLat(),
        fromStop.getStopLon(), toStop.getStopLat(), toStop.getStopLon());
  }
View Full Code Here

    BlockTripEntry blockTrip = blockStopTime.getTrip();
    BlockConfigurationEntry blockConfig = blockTrip.getBlockConfiguration();

    StopTimeEntry stopTime = blockStopTime.getStopTime();
    StopEntry stop = stopTime.getStop();

    return new BlockStopTimeKey(blockConfig.getServiceIds(), stop.getId());
  }
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.