Package org.onebusaway.transit_data.model.tripplanning

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


        targetTime, options);

    LocationBean fromBean = getPointAsLocation(from);
    LocationBean toBean = getPointAsLocation(to);

    ItinerariesBean itineraries = getPathsAsItineraries(paths, fromBean,
        toBean, options);

    ensureSelectedItineraryIsIncluded(from, to, targetTime, itineraries,
        constraints.getSelectedItinerary(), options);

    if (options.isArriveBy())
      Collections.sort(itineraries.getItineraries(), new SortByArrival());
    else
      Collections.sort(itineraries.getItineraries(), new SortByDeparture());

    return itineraries;
  }
View Full Code Here


        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()) {
          double t = currentTripDuration
              + (plan.getEndTime() - plan.getStartTime());
          if (minStop == null || t < minTime) {
            minTime = t;
            minStop = o;
View Full Code Here

  }

  private ItinerariesBean getPathsAsItineraries(List<GraphPath> paths,
      LocationBean from, LocationBean to, OBATraverseOptions options) {

    ItinerariesBean bean = new ItinerariesBean();
    bean.setFrom(from);
    bean.setTo(to);

    List<ItineraryBean> beans = new ArrayList<ItineraryBean>();
    bean.setItineraries(beans);

    boolean computationTimeLimitReached = false;

    if (!CollectionsLibrary.isEmpty(paths)) {
      for (GraphPath path : paths) {

        ItineraryBean itinerary = getPathAsItinerary(path, options);
        beans.add(itinerary);
      }
    }

    bean.setComputationTimeLimitReached(computationTimeLimitReached);

    return bean;
  }
View Full Code Here

        factory);

    parseSelectedItinerary(itineraryFactory, _includeSelectedItinerary,
        _constraints);

    ItinerariesBean itineraries = _transitDataService.getItinerariesBetween(
        _from, _to, _time, _constraints);

    ItinerariesV2Bean bean = itineraryFactory.getItineraries(itineraries);
    return setOkResponse(factory.entry(bean));
  }
View Full Code Here

     
      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;
        tTotal += tDiff;
        index++;
        double mu = tTotal / (double) index;
        System.out.println(index + " " + tDiff + " "
            + result.isComputationTimeLimitReached() + " " + mu);
       
        if( index == 400)
          break;
      }
    } catch (Exception ex) {
View Full Code Here

TOP

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

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.