This repository provides a MATSim model for Switzerland's railway developed by Swiss Federal Railways (Schweizerische Bundesbahnen, SBB), Corporate Development.
The railway model is generated by mapping GTFS train schedule data on OSM-based railway infrastructure (see prepare/GenerateRailsimInput.java
).
The simulation then makes use of the MATSim/railsim contrib which accounts for train-specific dynamics (for more information about railsim, see https://github.com/matsim-org/matsim-libs/tree/master/contribs/railsim).
Developers/Contributors: Merlin Unterfinger, Thomas Hettinger, Ihab Kaddoura
The MATSim program code in this repository is distributed under the terms of the GNU Affero General Public License v3.0. The MATSim program code are files that reside in the src
directory hierarchy and typically end with *.java
.
The MATSim input files, output files, analysis data and visualizations are licensed under a Creative Commons Attribution 4.0 International License.
MATSim input files are those that are used as input to run MATSim. They often, but not always, have a header pointing to matsim.org. They typically reside in the matsim_input
or scenarios
directory hierarchy. MATSim output files, analysis data, and visualizations are files generated by MATSim runs, or by postprocessing. They typically reside in a directory hierarchy starting with output
.
Other data files, in particular in original_data
, have their own individual licenses that need to be individually clarified with the copyright holders.
- Download the GTFS file, e.g., from https://opentransportdata.swiss/en/group/timetables-gtfs.
- Download the OSM file, e.g., from https://download.geofabrik.de/europe/switzerland.html.
- (Optional) Process the OSM data, e.g., with osmosis. Download osmosis from https://wiki.openstreetmap.org/wiki/Osmosis. Filter the OSM data, e.g. with the following command:
osmosis --rb file=switzerland-latest.osm.pbf --tf accept-ways railway=* --used-node --wx switzerland_railways.osm
- Put the GTFS file (
*.zip
) and (processed) OSM file (*.osm
) file into theoriginal_data
directory.
- Open the JAVA class
GenerateRailsimInput
located insrc/main/java/ch/sbb/prepare
. - Adjust the file names and make sure the files are locally available in the
original_data
directory. - Adjust some further inputs, e.g. rail product names, area of interest, ...
- Run the
GenerateRailsimInput
class. The preparation makes use of the pt2matsim repository, see here: https://github.com/matsim-org/pt2matsim
(Requires either cloning or downloading the repository.)
- Set up the project in your IDE.
- Make sure the project is configured as maven project.
- Run the JAVA class
src/main/java/ch/sbb/run/RunSwitzerlandRailway.java
. - "Open" the output directory. You can drag files into VIA as was already done above.
- Edit the config file or adjust the run class. Re-run MATSim.
(Requires either cloning or downloading the repository and java)
- Open the cmd and go to your project directory
- Build the scenario using
mvnw package
- There should be a
<...>.jar
file directly in the main directory. - Run this file from the command line using
java -jar <...>.jar --help
to see all possible options. - Start this scenario using the default config by running
java -jar <...>.jar
- "Open" the output directory. You can drag files into VIA as was already done above.