1.4 KiB
MATSim Runner Script
Requirements
- JDK 17
- Python 3
- Input file holding the network of the city (For example: merged-network.osm.pbf)
- Input GeoJSON file with all buildings (For example: summerschool_all_buildings.geojson)
Goal
Estimate city pollution coming from people driving in vehicles.
Setup
Make sure to have JDK 17 installed and clone this repository.
Usage
The file main.py
is essentially a replica from MEB workflow. It constructs a city and then allows the user to apply characteristics to that given city.
The additional steps from the MEB workflow are:
- Generate Matsim required xml files.
- Run Matsim analysis.
- Visualize Matsim results.
1- Generate Matsim Required XML Files
This step is done in matsim.py
. The class was built to replicate the behavior of other HUB export factory classes. It takes in a city object, an output directory, and then generates all the xml files required by Matsim.
2- Run Matsim Analysis
This step is done in matsim_engine.py
. It simply runs the matsim.jar while providing the config.xml file generated in the previous step.
3- Visualize Matsim Results
This step is done in matsim_visualizer.py
. It takes in a network and events xml file generated by the previous step and then displays it on a graph. It then shows in heatmap style the change in traffic over time.