fix: external inlinks for LTZ policy #295
Merged
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.
The LTZ policy currently can have certain edge cases where agents do traverse the Limited Traffic Zone, although they don't perform a stop inside. This happens if their origin is a link that is outside of the ZTL, but it leads to a node that has only outlinks that are inside the ZTL (i.e. their endpoint is inside). In that case the trip should perform a detour around the ZTL (and the agent will try to exit as quickly as possible due to the routing penalty), but the route will indeed pass through the ZTL for a small number of links.
This PR fixes the problem by first identifying all links that are inside the ZTL and then also including links that lead to intersections that don't have another exit than into the ZTL. The links are identified in a round-based approach.