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

OTP filters #5630

Open
t2gran opened this issue Jan 18, 2024 · 4 comments
Open

OTP filters #5630

t2gran opened this issue Jan 18, 2024 · 4 comments
Milestone

Comments

@t2gran
Copy link
Member

t2gran commented Jan 18, 2024

Goal / high level use-case

The goal is to create reusable, consistent way of doing filtering on the OTP APIs and configuration - and have a general implementation which can be tailred to each specific use-case. This should work with the goal of filtering transit data very efficient for performance reasons - (the idea is to use bitmaps for this).

This issue is manly a ticket for discussion.

Her is a diagram witch illustrate the design:

image

@t2gran t2gran added this to the 2.5 (next release) milestone Jan 18, 2024
@leonardehrenfried
Copy link
Member

In order to support flex it would be nice if this supported not only TripPatterns but also Trips. I sketched out a solution for flex filtering and it wasn't very hard to support both since the main methods to use (getRoute, getMode) are already present in both entities.

@t2gran
Copy link
Member Author

t2gran commented Jan 18, 2024

What is the attributes you use in Route? Maybe it is better to add explisit methods: getAgencyId() & getRouteId() instead of getRoute(). But, this is only a temporary solution, I want a generic framework for this. See the drawing above. Note! The expressions will not use an interface, instead I want the the mapping between the generic expressions and the domain classes to be handled by the factories - for example using lambdas. A key thing here is that we will cash leaf expressions as bitsets, so to do the filtering we only merge bitsets - not iterating over domain entities.

@t2gran
Copy link
Member Author

t2gran commented Jan 18, 2024

One thought - if we can make a cashed BitSet for every possible leaf-node in the expression, than we can eliminate the domain/entity dependency in the factories as well. Then the only thing we swap for filtering different types is the cashe.

PS! This is not possible at the moment because of the problems we have with inconsistency with RT updates. We need indexes over all entities filtered to do this. And these need to be consistent with the RT Transit Snapshot model.

@leonardehrenfried
Copy link
Member

How can I help with moving us into the right direction?

@t2gran t2gran modified the milestones: 2.5, 2.6 (next release) Mar 13, 2024
@github-actions github-actions bot added the Stale This issue is stale, no activity for 90 days. Remove stale label or comment within 30 days. label Jun 12, 2024
@leonardehrenfried leonardehrenfried removed the Stale This issue is stale, no activity for 90 days. Remove stale label or comment within 30 days. label Jul 11, 2024
@opentripplanner opentripplanner deleted a comment from github-actions bot Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants