feat: add StuckAgentsWriter for population analysis#4698
Open
gac55 wants to merge 3 commits into
Open
Conversation
Adds a new writer to track and report stuck agents in the simulation, including their final positions and states.
Adds a new writer to track and report stuck agents in the simulation, including their final positions and states.
This was referenced Feb 8, 2026
This file contains hidden or 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
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.
StuckAgentsWriter - Track and Analyze Stuck Agents
Adds a new writer to track and report stuck agents in the simulation, including their final positions and states. Can help debug, understand simulation calibration problems, or even unintended scenario testing problems.
This PR adds a new analysis tool to help diagnose simulation issues by tracking agents that get stuck during a MATSim run.
In response to #3008
What is this?
StuckAgentsWriter is an event handler that captures detailed information about stuck agents and outputs it to a structured XML file. This makes it easier to:
Features
Usage
As a standalone command:
Integrated into a contoller:
Output Format
The tool generates an XML file with the following structure:
It does capture "reason", if that exists in the events, 99.99% of the time it doesn't.
Testing
Includes unit tests covering:
This may need some work and testing before being ready.
Next iteration could infer the reason or cause, based upon some logic. e.g. miss the last bus, by checking timetable @kainagel?