Package org.onebusaway.transit_data.model.oba

Examples of org.onebusaway.transit_data.model.oba.MinTravelTimeToStopsBean


      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


    if (_time == 0)
      _time = System.currentTimeMillis();

    CoordinatePoint location = new CoordinatePoint(_lat, _lon);

    MinTravelTimeToStopsBean result = _transitDataService.getMinTravelTimeToStopsFrom(
        location, _time, _constraints);

    BeanFactoryV2 factory = getBeanFactoryV2();

    try {
View Full Code Here

  public MinTransitTimeResult getMinTravelTimeToStopsFrom(
      CoordinatePoint location, long time,
      TransitShedConstraintsBean constraints, int timeSegmentSize)
      throws ServiceException {

    MinTravelTimeToStopsBean minTravelTimeToStops = _transitDataService.getMinTravelTimeToStopsFrom(
        location, time, constraints);

    ConstraintsBean c = constraints.getConstraints();

    double maxWalkDistance = c.getMaxWalkingDistance();
    double walkingVelocity = minTravelTimeToStops.getWalkingVelocity() / 1000;

    CoordinateBounds b = SphericalGeometryLibrary.bounds(location, 800);
    double latStep = b.getMaxLat() - b.getMinLat();
    double lonStep = b.getMaxLon() - b.getMinLon();
    GridFactory gridFactory = new GridFactory(latStep, lonStep);
    TimedGridFactory timedGridFactory = new TimedGridFactory(latStep / 4,
        lonStep / 4, walkingVelocity);

    long maxTripLength = c.getMaxTripDuration() * 1000;

    for (int i = 0; i < minTravelTimeToStops.getSize(); i++) {

      double stopLat = minTravelTimeToStops.getStopLat(i);
      double stopLon = minTravelTimeToStops.getStopLon(i);

      long duration = minTravelTimeToStops.getTravelTime(i);

      double remainingWalkingDistance = (maxTripLength - duration)
          * walkingVelocity;
      remainingWalkingDistance = Math.min(remainingWalkingDistance,
          maxWalkDistance);
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.oba.MinTravelTimeToStopsBean

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.