One-To-Many rRaptor¶
Module contains One-To-Many rRAPTOR implementation
-
RAPTOR.one_to_many_rraptor.
onetomany_rraptor
(SOURCE: int, DESTINATION_LIST: list, d_time_groups, MAX_TRANSFER: int, WALKING_FROM_SOURCE: int, CHANGE_TIME_SEC: int, PRINT_ITINERARY: int, OPTIMIZED: int, routes_by_stop_dict: dict, stops_dict: dict, stoptimes_dict: dict, footpath_dict: dict, idx_by_route_stop_dict: dict) → list[source]¶ One-To-Many rRAPTOR implementation
- Parameters
SOURCE (int) – stop id of source stop.
DESTINATION_LIST (list) – list of stop ids of destination stop.
d_time_groups (pandas.group) – all possible departures times from all stops.
MAX_TRANSFER (int) – maximum transfer limit.
WALKING_FROM_SOURCE (int) – 1 or 0. 1 means walking from SOURCE is allowed.
CHANGE_TIME_SEC (int) – change-time in seconds.
PRINT_ITINERARY (int) – 1 or 0. 1 means print complete path.
OPTIMIZED (int) – 1 or 0. 1 means collect trips and 0 means collect routes.
routes_by_stop_dict (dict) – preprocessed dict. Format {stop_id: [id of routes passing through stop]}.
stops_dict (dict) – preprocessed dict. Format {route_id: [ids of stops in the route]}.
stoptimes_dict (dict) – preprocessed dict. Format {route_id: [[trip_1], [trip_2]]}.
footpath_dict (dict) – preprocessed dict. Format {from_stop_id: [(to_stop_id, footpath_time)]}.
idx_by_route_stop_dict (dict) – preprocessed dict. Format {(route id, stop id): stop index in route}.
- Returns
out (list): list of trips required to cover all optimal journeys Format: [trip_id] elif OPTIMIZED==0:
out (list): list of routes required to cover all optimal journeys. Format: [route_id]
- Return type
if OPTIMIZED==1
Examples
>>> output = onetomany_rraptor(36, [52, 43], pd.to_datetime('2019-06-10 00:00:00'), 4, 1, 0, 1, 0, routes_by_stop_dict, stops_dict, stoptimes_dict, footpath_dict, idx_by_route_stop_dict)
See also
One-To-Many rTBTR