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

Added the plan inheritance record inspector #23

Merged
merged 5 commits into from
Mar 5, 2024
Merged

Conversation

neuma
Copy link
Contributor

@neuma neuma commented Oct 19, 2023

Initial release of the Plan Inheritance Record Inspector

The app is built on Dash/Plotly. It allows to visually inspect the plan inheritance records of a MATSim run. Current status is:

  • Two tabs with visualizations: The Single Agent Analysis and the Top N Overview.
  • Added some patterns for interactions and styling that may facilitate the development of further analyses.
  • Largest setup tested featured 640k plan inheritance records - 84k agents with max 4 plans for 160 iterations.

Single Trip Analysis

  • Allows to inspects all plans of a single agent
  • Choose or type in an agent id
  • The table show all the plans of that agent - per default sorted by age
  • The left plot links each plan with its ancestor. Each plan is shown once as a single node. The colored nodes represent the the initial plan and the plans of the final choice-set.
  • The right plot follows the same lineage but features one node for each selected plan of each iteration. That is, a plan may be drawn more than once, if the plan had been selected in more than one iteration.
  • Both plots allow to hover over a node which then highlights the corresponding plan in the table.

image

Top N Overview

  • Allows to compare the lineage of the plans of the first n agent.
  • For each iteration, the node represents the selected plan.
  • Each selected plan is linked to its ancestor.

image

@rakow
Copy link
Collaborator

rakow commented Oct 20, 2023

Looks very impressive! I will try it next week and hopefully merge it by then.

@rakow rakow self-requested a review October 20, 2023 08:26
@rakow
Copy link
Collaborator

rakow commented Oct 25, 2023

I have a few requests that hopefully will improve the usability:

  • I would propose to move this file to a package named "viz", instead of "planInheritance". We may put other viz related things there if they come up.
  • In setup.py under extras_require please add a 'viz' entry and define the needed dependencies for this script.
  • It would be great if the main method makes use of an ArgumentParser and defines all configurable options. In this case at least the path to the plan record file, which is hard coded in the script right now.

@neuma
Copy link
Contributor Author

neuma commented Feb 28, 2024

@rakow Thanks for the your feedback.

I am not that familiar with the setuptools and don't know how to test this. From my understanding, pandas can be left out since this comes as a mandatory requirement and is thus installed by default. This reduces the optional dependencies for the viz component to

'viz': ["dash", "plotly.express", "dash_cytoscape", "dash_bootstrap_components"]

Or do I miss something?

@neuma
Copy link
Contributor Author

neuma commented Mar 5, 2024

Example data created from a 160 iterations run of the MATSim Sioux Falls Scenario and config switch

	<module name="planInheritance" >
		<!-- Specifies whether or not PlanInheritance Information should be tracked. -->
		<param name="enabled" value="true" />
	</module>

planInheritanceRecords.csv.gz
planInheritanceRecords_shares.csv
planInheritanceRecords_shares_selected.csv

Copy link
Collaborator

@rakow rakow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the dependencies to the setup.py and also added an entry point so that a cli script will be generated for it.

@rakow rakow merged commit 0e54a7d into matsim-vsp:master Mar 5, 2024
1 check passed
@neuma
Copy link
Contributor Author

neuma commented Mar 5, 2024

I added the dependencies to the setup.py and also added an entry point so that a cli script will be generated for it.

Thanks a lot

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