-
Notifications
You must be signed in to change notification settings - Fork 452
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
Handle mode restriction correctly #3348
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
paulheinr
force-pushed
the
mode-restriction
branch
from
July 3, 2024 16:42
0649405
to
40ef8a2
Compare
paulheinr
force-pushed
the
mode-restriction
branch
from
July 4, 2024 10:22
d2d25f3
to
79f0f23
Compare
rakow
reviewed
Jul 9, 2024
* @param network the network | ||
* @param modesToRemoveByLinkId map of modes that should be removed from the links | ||
*/ | ||
public static void restrictModesAndCleanNetwork(Network network, Map<Id<Link>, Set<String>> modesToRemoveByLinkId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a lambda Function<Id, Set here is probably a lot more flexible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good idea!
paulheinr
force-pushed
the
mode-restriction
branch
from
July 25, 2024 08:57
a47063e
to
bd0a8d0
Compare
paulheinr
force-pushed
the
mode-restriction
branch
from
July 25, 2024 09:10
bd0a8d0
to
1b9041f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If you restrict modes on links, there are in general two problems:
Both should be tackled with this PR. Therefore, several changes are needed.
New Config Parameter
In the Routing Config, there is the parameter
networkRouteConsistencyCheck
. If used withabortOnInconsistency
, inNetworkRoutingProvider
the network is checked against problem (1) and inPersonPrepareForSim
the routes of the agents are checked against problem (2).New Utils
For (1), there is now the class
NetworkModeRestriction
, which applies mode restriction and cleans the network. There is a corresponding function inNetworkUtils
For (2), there is now the class
PersonRouteCheck
, which deletes routes, if they use links which do not allow the mode any more. There is a corresponding function inPopulationUtils.
To discuss:
abortOnInconsistency
. This is quite restrictive, but helpful. Unfortunately, lots of tests are broken because of that :-( -> corrected all tests in the contribs. I will continue with the core, if this approach is accepted.ModeRestrictionTest
against whole events file and not against first leg. Need to comment the result very well then.