src/pathfinder.cpp
void PathFinder::getTripsWithinTime(int stop_id, bool outbound, double timepoint, std::vector<TripStopTime>& return_trips) const
    {
        // are there any trips for this stop?
        std::map<int, std::vector<TripStopTime> >::const_iterator mapiter = stop_trip_times_.find(stop_id);
        if (mapiter == stop_trip_times_.end()) {
            return;
        }
        for (std::vector<TripStopTime>::const_iterator it  = mapiter->second.begin();
                                                       it != mapiter->second.end();   ++it) {
            if (outbound && (it->arrive_time_ <= timepoint) && (it->arrive_time_ > timepoint-Hyperlink::TIME_WINDOW_)) {
                return_trips.push_back(*it);
            } else if (!outbound && (it->depart_time_ >= timepoint) && (it->depart_time_ < timepoint+Hyperlink::TIME_WINDOW_)) {
                return_trips.push_back(*it);
            }
        }
    }
/**
     * If outbound, then we're searching backwards, so this returns trips that arrive at the stop in time to depart at timepoint (timepoint-TIME_WINDOW_, timepoint]
     * If inbound,  then we're searching forwards,  so this returns trips that depart at the stop time after timepoint           [timepoint, timepoint+TIME_WINDOW_)
     */
If outbound, then we're searching backwards, so this returns trips that arrive at the stop in time to depart at timepoint (timepoint-TIME_WINDOW_, timepoint]
If inbound,  then we're searching forwards,  so this returns trips that depart at the stop time after timepoint           [timepoint, timepoint+TIME_WINDOW_)
If outbound then we ' re searching backwards so this returns trips that arrive at the stop in time to depart at timepoint ( timepoint - TIME_WINDOW_ timepoint ] If inbound then we ' re searching forwards so this returns trips that depart at the stop time after timepoint [ timepoint timepoint + TIME_WINDOW_ )
void PathFinder::getTripsWithinTime(int stop_id, bool outbound, double timepoint, std::vector<TripStopTime>& return_trips) const
    {
        std::map<int, std::vector<TripStopTime> >::const_iterator mapiter = stop_trip_times_.find(stop_id);
        if (mapiter == stop_trip_times_.end()) {
            return;
        }
        for (std::vector<TripStopTime>::const_iterator it  = mapiter->second.begin();
                                                       it != mapiter->second.end();   ++it) {
            if (outbound && (it->arrive_time_ <= timepoint) && (it->arrive_time_ > timepoint-Hyperlink::TIME_WINDOW_)) {
                return_trips.push_back(*it);
            } else if (!outbound && (it->depart_time_ >= timepoint) && (it->depart_time_ < timepoint+Hyperlink::TIME_WINDOW_)) {
                return_trips.push_back(*it);
            }
        }
    }
void PathFinder :: getTripsWithinTime ( int stop_id , bool outbound , double timepoint , std :: vector < TripStopTime > & return_trips ) const { std :: map < int , std :: vector < TripStopTime > > :: const_iterator mapiter = stop_trip_times_ . find ( stop_id ) ; if ( mapiter == stop_trip_times_ . end ( ) ) { return ; } for ( std :: vector < TripStopTime > :: const_iterator it = mapiter -> second . begin ( ) ; it != mapiter -> second . end ( ) ; ++ it ) { if ( outbound && ( it -> arrive_time_ <= timepoint ) && ( it -> arrive_time_ > timepoint - Hyperlink :: TIME_WINDOW_ ) ) { return_trips . push_back ( * it ) ; } else if ( ! outbound && ( it -> depart_time_ >= timepoint ) && ( it -> depart_time_ < timepoint + Hyperlink :: TIME_WINDOW_ ) ) { return_trips . push_back ( * it ) ; } } }
If outbound, then we're searching backwards, so this returns trips that arrive at the stop in time to depart at timepoint (timepoint-TIME_WINDOW_, timepoint]
 If inbound,  then we're searching forwards,  so this returns trips that depart at the stop time after timepoint           [timepoint, timepoint+TIME_WINDOW_)
If outbound then we ' re searching backwards so this returns trips that arrive at the stop in time to depart at timepoint ( timepoint - TIME_WINDOW_ timepoint ] If inbound then we ' re searching forwards so this returns trips that depart at the stop time after timepoint [ timepoint timepoint + TIME_WINDOW_ )
// are there any trips for this stop?