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

feat(srr): transit routing by transport mode utilities #3141

Merged
merged 5 commits into from
Mar 18, 2024

Conversation

sebhoerl
Copy link
Contributor

@sebhoerl sebhoerl commented Mar 6, 2024

This is a relatively simple PR that adds a new option to RaptorParameters called useTransportModeUtilities. If it is set to true (default is false), SwsissRailRaptor will calculate the utility of a leg while routing based on the transportMode that is defined in the schedule for the respective TransitRoute, rather than using the generic pt.

Such a behavior could already be achieved by defining "mode mappings", but this forces the user to introduce many individual leg modes, which means that one needs to deal with them in analysis. Plus, the mode mapping approach doesn't allow distinguishing between scoring generic transit trip vs. deciding which path to take while routing (which is not the same).

Another alternative would be to use RaptorInVehicleCostCalculator, but the interface, currently, does not pass the TransitRoute or anything else into getInVehicleCost that would allow returning a transportMode dependent cost. We could discuss extending the interface instead of the present PR, but I think it would have additional implications for other places such as the OccupancyTracker, etc.

See the new unit test for an example.

@sebhoerl sebhoerl requested a review from jfbischoff March 6, 2024 06:37
@sebhoerl sebhoerl closed this Mar 10, 2024
@sebhoerl sebhoerl reopened this Mar 10, 2024
@sebhoerl
Copy link
Contributor Author

@jfbischoff Any opinion on that, or maybe even a better solution somewhere lying around? :)

@jfbischoff
Copy link
Collaborator

Hi, sorry for the lenghtly response, I was sitting at the beach 🏖️
I think this is very reasonable, thanks for the idea.

@jfbischoff jfbischoff enabled auto-merge March 18, 2024 07:30
@jfbischoff jfbischoff merged commit 73d5d76 into master Mar 18, 2024
48 checks passed
@jfbischoff jfbischoff deleted the feat/raptor-transport-mode-utilities branch March 18, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants