# Path: gtfspy/routing/connection.py
# class Connection:
# 
#     WALK_SEQ = -1
#     WALK_TRIP_ID = -1
# 
#     def __init__(self, departure_stop, arrival_stop, departure_time, arrival_time, trip_id, seq,
#                  is_walk=False, arrival_stop_next_departure_time=float('inf')):
#         self.departure_stop = departure_stop
#         self.arrival_stop = arrival_stop
#         self.departure_time = departure_time
#         self.arrival_time = arrival_time
#         self.trip_id = trip_id
#         self.is_walk = is_walk
#         self.seq = int(seq)
#         self.arrival_stop_next_departure_time = arrival_stop_next_departure_time
# 
#     def duration(self):
#         return self.arrival_time - self.departure_time
# 
#     def __str__(self):
#         return pformat(self.__dict__)
# 
#     def __eq__(self, other):
#         return self.__dict__ == other.__dict__
# 
#     def __repr__(self):
#         return '<%s:%s:%s:%s:%s:%s:%s:%s>' % (
#             self.__class__.__name__, self.departure_stop, self.arrival_stop,
#             self.departure_time, self.arrival_time, self.trip_id, self.is_walk, self.arrival_stop_next_departure_time)
# 
#     def __hash__(self):
#         return hash(self.__repr__())


from gtfspy.routing.connection import Connection
        current_trip_id = None
        for leg in self.legs:
            if leg.trip_id is not None and leg.trip_id != current_trip_id and previous_arrival_stop is not None:
                transfer_stop_pair = (previous_arrival_stop, leg.departure_stop)
                transfer_stop_pairs.append(transfer_stop_pair)
            previous_arrival_stop = leg.arrival_stop
            current_trip_id = leg.trip_id
        return transfer_stop_pairs

    def get_transfer_trip_pairs(self):
        pass

    def get_waiting_times(self):
        waiting_times = []
        previous_arrival = None
        for leg in self.legs:
            current_departure = leg.departure_time
            if previous_arrival:
                waiting_times.append(current_departure - previous_arrival)
            previous_arrival = leg.arrival_time
        return waiting_times

    def get_total_waiting_time(self):
        waiting_times = self.get_waiting_times()
        waiting_total = sum(waiting_times)
        return waiting_total

    def get_invehicle_times(self):
        invehicle_times = []
        for leg in self.legs:

# Path: gtfspy/routing/connection.py
# class Connection:
# 
#     WALK_SEQ = -1
#     WALK_TRIP_ID = -1
# 
#     def __init__(self, departure_stop, arrival_stop, departure_time, arrival_time, trip_id, seq,
#                  is_walk=False, arrival_stop_next_departure_time=float('inf')):
#         self.departure_stop = departure_stop
#         self.arrival_stop = arrival_stop
#         self.departure_time = departure_time
#         self.arrival_time = arrival_time
#         self.trip_id = trip_id
#         self.is_walk = is_walk
#         self.seq = int(seq)
#         self.arrival_stop_next_departure_time = arrival_stop_next_departure_time
# 
#     def duration(self):
#         return self.arrival_time - self.departure_time
# 
#     def __str__(self):
#         return pformat(self.__dict__)
# 
#     def __eq__(self, other):
#         return self.__dict__ == other.__dict__
# 
#     def __repr__(self):
#         return '<%s:%s:%s:%s:%s:%s:%s:%s>' % (
#             self.__class__.__name__, self.departure_stop, self.arrival_stop,
#             self.departure_time, self.arrival_time, self.trip_id, self.is_walk, self.arrival_stop_next_departure_time)
# 
#     def __hash__(self):
#         return hash(self.__repr__())


# Path: gtfspy/routing/forwardjourney.py
from gtfspy.routing.connection import Connection

        current_trip_id = None
        for leg in self.legs:
            if leg.trip_id is not None and leg.trip_id != current_trip_id and previous_arrival_stop is not None:
                transfer_stop_pair = (previous_arrival_stop, leg.departure_stop)
                transfer_stop_pairs.append(transfer_stop_pair)
            previous_arrival_stop = leg.arrival_stop
            current_trip_id = leg.trip_id
        return transfer_stop_pairs

    def get_transfer_trip_pairs(self):
        pass

    def get_waiting_times(self):
        waiting_times = []
        previous_arrival = None
        for leg in self.legs:
            current_departure = leg.departure_time
            if previous_arrival:
                waiting_times.append(current_departure - previous_arrival)
            previous_arrival = leg.arrival_time
        return waiting_times

    def get_total_waiting_time(self):
        waiting_times = self.get_waiting_times()
        waiting_total = sum(waiting_times)
        return waiting_total

    def get_invehicle_times(self):
        invehicle_times = []
        for leg in self.legs:

            assert(isinstance(leg, Connection))