-
Notifications
You must be signed in to change notification settings - Fork 45
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
Question: How does Motis CSA handle splitting and joining trains? #431
Comments
Hey! 😄 👋 We call the following services "rule services":
In our approach, we need to consider both of them together to provide correct results (regarding Pareto-optimality). Let's consider the following services, rules and their connection. Services are the nodes at the bottom, rules the top nodes where Note that those rules apply to specific days. For simplicity, I assume that all rules active on the same days and no service is "cut". This means there's no case where another service outside the timetable period would be required to have all trains of the rule operating and no rule service participant is missing a matching partner. Let's assume the trains visit the following stations: From this network, we can derive something we call For our example, the set of These services allow for all travel options a traveler would have considering that a interchange between two merged trains is not counted as a real interchange. The same is true for the change between services for through trains. Those Code that handles rule services:
If you want to handle this topic correctly (in terms of preserving Pareto-optimality), it escalates quickly. Especially the part that I omitted before (generating rule service constructs with uniform traffic days) can be tricky. The basic idea is that you iterate through the first graph (with MS and T nodes) and intersect bitfields until all bits are zero or there's no further service (graph traversal with early termination if bitfields became zero). Each time the component that was traversed is cut out of the graph (bits set to zero) and written as rule service construct with uniform traffic days). Feel free to ask more questions. |
Ah.. and to answer your actual question: the CSA algorithm stays the same, just the connections array, etc. are derived from those The new core ( |
I am working on a new routing engine for https://bahnvorhersage.de/ that is able to perform a search for alternatives connections if a connection not work, so that a passanger can plan for journeys with reliable alternatives.
Currently I'm trying to figure out how i might handle splitting an joining trains in my CSA implementation. If I understand correctly, motis implements a CSA that can handle these types of trains. Could you give me some details on how motis is handeling this or where I can find it in the code?
The text was updated successfully, but these errors were encountered: