Relaxed limited transfer search #7145
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for a complimentary search that is run in addition to the regular raptor search. This new search extends the search result with "direct" transit paths, that is paths with a single transit leg. In contrast to raptor it returns paths even if they are not optimal according to any criteria. It can be configured to run with access/egress or only for stop to stop searches.
The main use case for this additional search is to show slower journeys such as regional trains, slower buses etc that are not included in the main raptor search. See the highlighted journey in the example below, using an ordinary raptor search it will never show up in a search results because the previous journey is better in all criteria.
Issue
Closes #6977. See issue for detailed use cases.
Implementation
The search is implemented in the raptor module and runs on the raptor transit data in order to take advantage of the cost calculation and the itinerary mapping.
Naming
The name RelaxedLimitedTransferSearch was chosen together with @t2gran. "Relaxed" comes from the fact that the search uses a relax function to decide what trips are included. "LimitedTransfer" is because Entur is interested in extending this in the future to work with not only direct transit, but also specific single transfer journeys like stay-seated transfers and transfers to replacement buses.
Configuration
This feature is currently not exposed through any api and is configurable through
router-config.json. It takes three configuration parameters:costRelaxFunctionIn order to exclude really bad paths there is a cost function that is used to reject paths that are much more expensive than the cheapest path.
extraAccessEgressCostFactorWhen using this search in an area with lots of transit options such as a city center it can produce too many results where one walks for a while, takes a short transit and then walks to the destination. Having too many of these alternatives will not be useful to travelers. They can be limited using an extra cost on accesses and egresses that is specific for this search.
disableAccessEgressThe search can also be configured to not use access/egress at all. In that case it will only be used when searching to and from a stop or station.
Bumping the serialization version id
Yes, updating the route request.