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

Implement a day-mask #23

Open
xivk opened this issue Jan 12, 2019 · 1 comment
Open

Implement a day-mask #23

xivk opened this issue Jan 12, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request high-priority

Comments

@xivk
Copy link
Contributor

xivk commented Jan 12, 2019

Problem

Connections are now stored per 24h sorted by departure time. Each connection is stored individually, this means that storing 2 days of connections takes 2x the storage. This doesn't scale properly for some of the use cases this library is meant to support:

  • Planning routes in the future.
  • Supporting offline routing on the planned schedules.
  • ...

Solution Proposal

We should add a mask to the connections instead of a date. That mask describes the schedule that determines when the connections are active.

@xivk xivk added the enhancement New feature or request label Jan 12, 2019
@xivk xivk self-assigned this Jan 12, 2019
@xivk xivk added the backlog This requires fixing at some point, but not right now. label Jan 12, 2019
@pietervdvn
Copy link
Contributor

A daymask could look as:

"Connection departs at 10:00, from station A to station B, has tripId 123" * ( DATE0, DATE1, DATE2, ....)

The exposing API (towards the algorithms, that is) would boil down to enumerating all these connections.

Adding realtime info can be done by creating an exceptions-object. This exceptions object would enumerate connections as well, but amend this enumeration: delayed connections should be given on later, earlier departures given earlier.

For this, the 'RealTime' object can keep a list of 'exceptions', sorted by original and new departure time. This way, the enumerator should be able to quickly detect when a connection (from the regular enumerator) should be dropped or when it should be extra included.

@pietervdvn pietervdvn added high-priority and removed backlog This requires fixing at some point, but not right now. labels Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high-priority
Projects
None yet
Development

No branches or pull requests

2 participants