Install MATSim

MATSim is mostly a software framework to be configured and enhanced with your own code. While MATSim can be started standalone, it only offers a very simple user interface. To get the most out of MATSim, you will likely have to use MATSim as a framework or library and write code to customize its functionality.

Use MATSim as a programmer out of an IDE

This approach targets programmers who are comfortable with Java and an IDE (e.g. Eclipse or IntelliJ). This will automatically download MATSim, allow you to browse the source code, and keep you up-to-date with releases or snapshots.

Install

  1. (optional but recommended) Fork matsim-example-project.
  2. Clone matsim-example-project into local directory.
  3. Import as Maven project into IDE. Maven will sort out the dependencies. No need to download the MATSim main repository. Sources are available.
    • IntelliJ: Import project → browse to directory → Maven → Next, Next, Next
    • Eclipse: Import … → … as Maven project → browse to directory → accept, accept, accept
  4. Run MATSimGUI from the IDE.
    • An example config file is in scenarios/equil.
    • Press Run to run MATSim.
  5. (optional but recommended) Run RunMATSim from the IDE.
  6. (optional but recommended) Set up, for your forked repo, a continuous integration (CI) workflow. On the github website of your repo: ActionsNew WorkflowMore continuous integration workflows...Java with MavenSet up this workflowStart commit.... This will result in a file .github/workflows/maven.yml which triggers the automatic build after each commit. Detailed configuration of the workflow via this file is possible at a later point in time.

Notes

  • Code examples are in matsim-code-examples on github. Also see there for examples of how to use extensions (package extensions).

  • If you want/need to write your own extensions:

    1. Again, look at matsim-code-examples for examples.
    2. Look at ControlerDefaultsModule (in your IDE, source is retrieved by Maven) to see how MATSim is plugged together.
  • You will not be able to modify the existing MATSim source code. This is an advantage, since it improves scientific reproducibility. If you feel the need to modify the existing MATSim source code, please use https://matsim.org/faq and we will try to help or implement missing extension points.

  • You can generate a “clickable jar file” of your own code with mvn package. This could, for example, be passed on to students or clients for specific studies.

Use the MATSim GUI

This “standalone” version is targeted to users who want to use MATSim by editing the input files, including config.xml directly. A basic GUI is provided.

  1. Download matsim-example-project and unzip it. There is an option “download zipfile”; no need to use git.
  2. A clickable jar file is no longer provided, since they make the git repo too large. Instead, follow the instructions under “Building and Running it locally” at matsim-example-project.
  3. As stated there, you will be able to double click on the generated MATSim jar file. What opens is what we call the MATSim GUI.
    • An example config file is in scenarios/equil.
    • Press Run to run MATSim.

The logfile contains, between a lot of other information, also a dump of the full matsim configuration. If there are interesting parameters, you could try to copy then into your own config file, modify them, and re-run.

In my (kn’s) view, one can actually get quite far in this way, i.e. by editing the config file. The main problem is how to obtain the network and in particular the so-called initial demand for your own scenario. If you can’t get that from somewhere else, it is probably better to go through the tutorial.

Use MATSim as a dependency

The “Maven” version (or alternatively also Gradle) is targeted to programmers who know about Maven, and want to include MATSim into an already existing Maven project.

Similar to the “MATSim example project” above, the Maven approach will automatically download MATSim, allow you to browse the source code, and keep you up-to-date with releases or snapshots (depending on your pom.xml).

It will not allow you to modify the existing MATSim code – which, in most cases, also should not be necessary: it is preferred that you contact the developers in such situations and we will try to help or implement missing extension points.

(Pre-)Release

<repositories>
  <repository>
    <id>matsim</id>
    <name>MATSim Maven repository</name>
    <url>https://repo.matsim.org/repository/matsim/</url>
  </repository>
</repositories>
<dependencies>
  <dependency>
    <groupId>org.matsim</groupId>
    <artifactId>matsim</artifactId>
    <version>20XX.0</version>
  </dependency>
</dependencies>

The example project on GitHub contains a valid pom.xml.

Extensions can be added in the same way; see the pom.xml in the code examples on GitHub

Automatic snapshot of development version

<repositories>
  <repository>
    <id>matsim</id>
    <name>MATSim Maven repository</name>
    <url>https://repo.matsim.org/repository/matsim/</url>
  </repository>
</repositories>
<dependencies>
  <dependency>
    <groupId>org.matsim</groupId>
    <artifactId>matsim</artifactId>
    <version>20XX.0-SNAPSHOT</version>
  </dependency>
</dependencies>

These versions are typically less stable and don’t come with up-to-date documenation, but may contain new features.

Tools around MATSim

Besides the MATSim framework itself, a number of tools exist for building scenarios and for analyzing and visualizing simulation output. Some are open source, others are commercially licensed; the licensing of each tool is stated below. The tools are listed alphabetically. This overview is a pointer to what exists in the MATSim ecosystem, not an endorsement — the MATSim project has no control over these tools, their licenses, or their prices. If you maintain a MATSim-related tool that is missing here, please let us know.

Creario

Creario is a commercial service creating complete, multi-modal MATSim scearios for any place on earth.

By using a wide variety of data sources, Creario is able to create MATSim models with a high level of detail anywhere on earth: high-resolution road networks including turn restrictions, well-categorized facilities with opening times, a public transport schedule and an agent-population with various person-attributes and complete daily activity plans. Each model comes with a detailed report with various validations. Thanks to an automated pipeline, models can typically be created within hours. If custom data is available, such data can be uploaded and included to increase the fidelity of the created models.

The cost of models varies based on the size and included features; reduced pricing for research purposes is available.

MobilityStudio

MobilityStudio is a commercial desktop application with a graphical user interface for working with MATSim scenarios. Scenario elements — network, transit schedule, vehicles, plans, facilities, DRT service areas, etc. — can be created from scratch or edited interactively on a map or in a synchronized table view, with validation and batch editing. Existing MATSim files, including events, trips and legs, open by drag and drop; elements can be styled by attribute-based rules for colors, symbols, sizes/widths and labels; and all files can be exported in the native MATSim format.

Simulation runs can be started from within the application, locally or on a server, and the output inspected in the same environment: events replayed as an interactive animation, plus link volumes, difference plots between scenarios, and statistics aggregated per mode or stop.

MobilityStudio requires a license; commercial and reduced academic licenses as well as a free test version are offered.

SimWrapper

SimWrapper is a free and open-source web app, online at simwrapper.github.io. SimWrapper can natively visualize MATSim output trips, carrier/freight/logistic systems, and public transport networks, and can also be used in combination with the open source matsim-r and matsim-python post-processing libraries to produce comprehensive output dashboards for traffic, emissions, noise, and more.

There is a matsim contrib which produces standard SimWrapper dashboards to get you started: you only need to add one line of code to your main function to produce a full-featured SimWrapper dashboards. Details are at github.com/matsim-org/matsim-libs/tree/master/contribs/simwrapper. Full documentation of the SimWrapper tool is online at simwrapper.github.io/docs.

Tramola

Tramola is a commercial application providing a complete work bench for working with MATSim: Editing scenarios to create case studies, managing multiple scenarios, running simulations locally or remotely, and analyzing and visualizing runs.

The map-based editor allows to easily make changes to network, public transport schedules, vehicle fleets or DRT services, while included validations help to build high-quality models. Simulation runs can be configured and started from within the application — locally or on remote servers, including HPC Slurm clusters. Results can be analyzed in configurable dashboards that compare multiple runs, and in an interactive visualizer offering a variety of visualizations and analysis options, including vehicle animation, network attribute styling, link volumes and flow bundle (select link) analysis, and public transport analyses.

Tramola can be run individually on a laptop or desktop, or as a web application suitable for a whole team, allowing users to work together, and share scenarios and runs.

Commercially licensed; license variants for individuals and smaller groups as well as for larger groups are offered, with reduced prices for academic institutions.

Via

Via is a commercial desktop application for analyzing and visualizing MATSim output. Network and events files are added as data sources and then combined into layers, e.g. a network layer and a vehicle layer, which animates the movement of vehicles and agents over the course of the simulated day. Layer styling can be driven by attributes, and results can be aggregated into heatmaps and other summary views for comparing scenarios or presenting them to stakeholders. Images and animations can be exported for use in reports and presentations.

Plugins add support for advanced public transport analyses, additional MATSim features such as Emissions, Car Counts and Road Pricing, and powerful aggregation analyses.

Commercially licensed with reduced prices for academic institutions; a free version with a limited number of agents is available.

About releases

We normally release together with our summer term class taught at TU Berlin:

  1. A pre-release in March/April.
  2. Possible bugfix versions while the class is running.
  3. In June/July, the last bugfix version becomes the stable release.

In consequence, the “latest (pre-)release” may be more modern than the “latest stable release”.

Open Data Models

There are a few MATSim models available freely that you can use to get started, play around, or test your own algorithms with. Have a look at our dedicated page for open data models to see what models are available.

Benchmark

Download Benchmark ZIP, ca. 180 MB

More information about the MATSim Benchmark.