kuanb / peartree

peartree: A library for converting transit data into a directed graph for sketch network analysis.
MIT License
201 stars 23 forks source link

Customize wait time / node impedance calculation for synthetic nodes #146

Closed kuanb closed 5 years ago

kuanb commented 5 years ago

When loading from a custom transit JSON, user should be able to customize how wait time is calculated:

https://github.com/kuanb/peartree/blob/0c5073d8b62a49ea299e8e2c2df1369fc4dcb3ea/peartree/synthetic.py#L231

Update so that a param is passed that provides a method for processing headway.

Example:

calc_wait_time_from_hway = lambda x: x * 0.5

SyntheticTransitLine
    ...
    self._wait_time_calculator = calc_wait_time_from_hway