src/pathfinder.cpp
double PathFinder::getScheduledDeparture(int trip_id, int stop_id, int sequence) const
    {
        std::map<int, std::vector<TripStopTime> >::const_iterator tsti = trip_stop_times_.find(trip_id);
        if (tsti == trip_stop_times_.end()) { return -1; }

        for (size_t stt_index = 0; stt_index < tsti->second.size(); ++stt_index)
        {
            if (tsti->second[stt_index].stop_id_ != stop_id) { continue; }
            // trip id matches and stop id matches -- does sequence match or is it unspecified?
            if ((sequence < 0) || (sequence == tsti->second[stt_index].seq_)) {
                return tsti->second[stt_index].depart_time_;
            }
        }
        return -1;
    }
/**
     * Returns the departure time for the transit vehicle from the given stop/seq for the given trip.
     * Returns -1 on failure.
     */
Returns the departure time for the transit vehicle from the given stop/seq for the given trip.
Returns -1 on failure.
Returns the departure time for the transit vehicle from the given stop / seq for the given trip . Returns - 1 on failure .
double PathFinder::getScheduledDeparture(int trip_id, int stop_id, int sequence) const
    {
        std::map<int, std::vector<TripStopTime> >::const_iterator tsti = trip_stop_times_.find(trip_id);
        if (tsti == trip_stop_times_.end()) { return -1; }
        for (size_t stt_index = 0; stt_index < tsti->second.size(); ++stt_index)
        {
            if (tsti->second[stt_index].stop_id_ != stop_id) { continue; }
            if ((sequence < 0) || (sequence == tsti->second[stt_index].seq_)) {
                return tsti->second[stt_index].depart_time_;
            }
        }
        return -1;
    }
double PathFinder :: getScheduledDeparture ( int trip_id , int stop_id , int sequence ) const { std :: map < int , std :: vector < TripStopTime > > :: const_iterator tsti = trip_stop_times_ . find ( trip_id ) ; if ( tsti == trip_stop_times_ . end ( ) ) { return -1 ; } for ( size_t stt_index = 0 ; stt_index < tsti -> second . size ( ) ; ++ stt_index ) { if ( tsti -> second [ stt_index ] . stop_id_ != stop_id ) { continue ; } if ( ( sequence < 0 ) || ( sequence == tsti -> second [ stt_index ] . seq_ ) ) { return tsti -> second [ stt_index ] . depart_time_ ; } } return -1 ; }
Returns the departure time for the transit vehicle from the given stop/seq for the given trip.
Returns the departure time for the transit vehicle from the given stop / seq for the given trip .
// trip id matches and stop id matches -- does sequence match or is it unspecified?