Build TBTR dict¶
Builds data structure for TBTR related algorithms
-
build_TBTR_dict.
algorithm1_parallel
(route_details: tuple) → list[source]¶ Collects all possible trip transfers.
- Parameters
route_details (list) – tuple of format: (route id, list of trips)
- Returns
list of trip-transfers format [(from trip id, from stop id, to strip id, to stop id)]
-
build_TBTR_dict.
algorithm2_parallel
(trip_transfer_: list) → list[source]¶ Removes trip transfers which cause U-turns.
- Parameters
trip_transfer (list) – trip transfers. Format : [‘index’, ‘from_routeid’, ‘from_tid’, ‘to_routeid’, ‘to_tid’, ‘from_stop_index’, ‘to_stop_index’]
- Returns
Returns the index if the trip-transfer is optimal. Else empty list