Standard CSA

Module contains standard Connection Scan Algorithm (CSA) implementation.

Algorithms.CSA.std_csa.std_csa(SOURCE: int, DESTINATION: int, D_TIME, connections_list: list, WALKING_FROM_SOURCE: int, footpath_dict: dict, PRINT_ITINERARY: int)tuple[source]

Standard CSA implementation

Parameters
  • SOURCE (int) – stop id of source stop.

  • DESTINATION (int) – stop id of destination stop.

  • D_TIME (pandas.datetime) – departure time.

  • connections_list

  • WALKING_FROM_SOURCE (int) – 1 or 0. 1 indicates walking from SOURCE is allowed.

  • footpath_dict (dict) – preprocessed dict. Format {from_stop_id: [(to_stop_id, footpath_time)]}.

  • PRINT_ITINERARY (int) – 1 or 0. 1 means print complete path.

Returns

tuple containing the best arrival time.

Return type

output (tuple)

Examples

>>> output = std_csa(36, 52, pd.to_datetime('2022-06-30 06:30:00'), connections_list, 1, footpath_dict, 1)
>>> print(f"Optimal arrival time is: {output}")