ferrobus.travel_time_statistics#
- ferrobus.travel_time_statistics(transit_model, points, departure_time, max_transfers, threshold=0.75, stat='mean', filter_cutoff=None)#
Computes travel time statistics from each point to all targets in parallel.
For each origin point, returns the travel time statistic to reachable targets only if at least the specified percentage of all targets are reachable; otherwise returns None.
- Parameters:
transit_model (TransitModel) – The transit model to use for routing.
points (list[TransitPoint]) – List of points used as both origins and targets.
departure_time (int) – Time of departure in seconds since midnight.
max_transfers (int) – Maximum number of transfers allowed in route planning.
threshold (float, default = 0.75) – Percentage of target points which must be reached to allow statistics.
stat (str, default = "mean") –
Statistic computed from reachable travel times:
”mean” — arithmetic mean travel time
”median” — median travel time
filter_cutoff (Optional[int], default = None) – If provided, excludes destinations with travel time strictly greater than this cutoff (in seconds) from the statistic computation.
- Returns:
A list where each element corresponds to an origin point and contains the computed travel time statistic in seconds, or None if fewer than the specified percentage of targets are reachable from that origin.
- Return type:
list[Optional[float]]