Package org.onebusaway.transit_data.model.tripplanning

Examples of org.onebusaway.transit_data.model.tripplanning.TransitLocationBean


      Collections.sort(closestStops);

      double minTime = 0;
      TripToStop minStop = null;

      TransitLocationBean place = new TransitLocationBean();
      place.setLat(result.getLat());
      place.setLon(result.getLon());

      for (TripToStop o : closestStops) {

        long currentTripDuration = o.getTransitTimeToStop();
        double minTimeToPlace = o.getMinTansitTimeToPlace();

        // Short circuit if there is no way any of the remaining trips is going
        // to be better than our current winner
        if (minStop != null && minTimeToPlace > minTime)
          break;

        int remainingTime = (int) ((maxTripLength - currentTripDuration) / 1000);
        walkConstraints.setMaxTripDuration(remainingTime);

        int index = o.getIndex();
        TransitLocationBean stopLocation = new TransitLocationBean();
        stopLocation.setLat(travelTimes.getStopLat(index));
        stopLocation.setLon(travelTimes.getStopLon(index));

        ItinerariesBean itineraries = getItinerariesBetween(stopLocation,
            place, System.currentTimeMillis(), walkConstraints);

        for (ItineraryBean plan : itineraries.getItineraries()) {
View Full Code Here


      constraints.setMaxComputationTime(20000);
      constraints.setResultCount(3);
      constraints.setUseRealTime(true);
     
      for (Pair<CoordinatePoint> pair : points) {
        TransitLocationBean from = new TransitLocationBean(pair.getFirst());
        TransitLocationBean to = new TransitLocationBean(pair.getSecond());
        long tIn = System.currentTimeMillis();
        ItinerariesBean result = _transitDataService.getItinerariesBetween(
            from, to, _time.getTime(), constraints);
        long tOut = System.currentTimeMillis();
        long tDiff = tOut - tIn;
View Full Code Here

  @Override
  public ItinerariesBean getTripsBetween(CoordinatePoint from,
      CoordinatePoint to, long time, ConstraintsBean constraints)
      throws ServiceException {
    TransitLocationBean fromLoc = new TransitLocationBean();
    fromLoc.setLat(from.getLat());
    fromLoc.setLon(from.getLon());
    TransitLocationBean toLoc = new TransitLocationBean();
    toLoc.setLat(to.getLat());
    toLoc.setLon(to.getLon());
    return _transitDataService.getItinerariesBetween(fromLoc, toLoc, time,
        constraints);
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.tripplanning.TransitLocationBean

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.