Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add strategy parameter to frequencies_to_stop_times() #56

Open
dhersz opened this issue May 24, 2022 · 1 comment
Open

Add strategy parameter to frequencies_to_stop_times() #56

dhersz opened this issue May 24, 2022 · 1 comment
Labels

Comments

@dhersz
Copy link
Member

dhersz commented May 24, 2022

Right now stop times trips are added to stop_times following the start_time, end_time and headway_secs exactly. But when exact_times = 0, services don't have a fixed schedule but try to adhere to a specific frequency.

So for example, if we have start_time = 7:00, end_time = 9:00, headway_secs = 120 and exact_times = 1, we can easily say that the new trips in stop_times will depart at 7:00:00, 7:02:00, 7:04:00, ...

If we had the same case but exact_times = 0, we wouldn't know at which time the first trip departed though, but we currently use the same approach as exact_times = 1 above. Another strategy, for example, would be to "offset" the trips with half the headway, yielding trips departir at 7:01:00, 7:03:00, 7:05:00, etc.

Yet another strategy would be to randomize the first departure, similar to what R5 does with frequency-described trips. So the result could look something like 7:00:19, 7:02:19, 7:04:19, etc.

So currently this parameter could take the values c("exact", "half_headway", "random") (the names are definitely not set in stone yet). Any other strategy we could implement?

@dhersz dhersz added the v1.2.0 label May 24, 2022
@rafapereirabr
Copy link
Member

I like the three stratagies you proposed, and I'm fine with the values' names. What strategy should be the default? "half_headway"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants