Contents

Use MATSim as a programmer out of an IDE

Use the MATSim GUI

Use MATSim as a maven plugin

Visualization

About releases

Benchmark

 

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.
    1. IntelliJ: Import project –> browse to dir –> maven –> Next, Next, Next
    2. Eclipse: Import … –> … as maven project –> browse to dir –> accept, accept, accept
  4. Run MATSimGUI .
    1. An example config file is in scenarios/equil.
    2. Press Run to run MATSim.
  5. Run RunMATSim directly from the IDE.
  6. (optional but recommended) Connect your forked repo to travis.

Notes:

 

Use the MATSim GUI

The “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 the release and unzip it.
  2. Go the the directory where you find matsim-*.jar.
  3. Double click on the MATSim jar file. What opens is what we call the MATSim GUI.
    1. An example config file is in scenarios/equil.
    2. Pres Run to run MATSim.

The logfile contains, between a lot of other information, also a dump of a 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 just 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.

Latest Stable Release

Version 0.10.1 “Summer 2018”, released August 2018

Development Version

This (= using a development version of MATSim via the GUI) is not recommended any longer. If you cannot work with a release, you should use the IDE and maven.

 

Use MATSim as a maven plugin

The “Maven” version 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 maven-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 release repository</name>
    <url>http://dl.bintray.com/matsim/matsim</url>



  </repository>
</repositories>
<dependencies>
  <dependency>
    <groupId>org.matsim</groupId>
    <artifactId>matsim</artifactId>
    <version>11.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>ojo-snapshots</id>
    <name>MATSim snapshot repository</name>
    <url>http://oss.jfrog.org/libs-snapshot</url>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </repository>
</repositories>
<dependencies>
  <dependency>
    <groupId>org.matsim</groupId>
    <artifactId>matsim</artifactId>
    <version>12.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.

 

Visualization

When the simulation ran, many files were created in its output directory. Note that the GUI has a button to reach the output directory. One of the files is a so-called events file, typically generated for every 10th iteration. The events file for the zeroth iteration is located in .../ITERS/it.0/...0.events.xml.gz. This contains a lot of information that can be visualized.

The easiest way to visualize MATSim output is to use VIA. A free version, with a limit on the number of agents, is available for download. If you start VIA, you should see a large, black area. This is where the traffic will be visualized. On the left side of this area, you see a smaller area with 4 icons on the top (“Controls”). Click the first icon (Data Sources). Now you can either drag and drop files into this section (e.g. a network.xml, or events.xml.gz), or click the “+” at the bottom to select a file to be added. Use either option to add first network.xml to the list of available data and then events.xml.gz. Now the visualizer knows about our data, and we can tell it how to visualize it.

Next, click on the second icon (“Layers”) in the Controls section. Initially, you will see only the background layer listed. Click on the ‘+’ to select the data you want to have displayed. It should already suggest to visualize the network with the loaded network.xml, so just click Add. After a short moment, the network should be shown in the visualization area. Click the ‘+’ again, but this time choose Vehicles as layer type. The events.xml.gz file will be already pre-selected. Click on Add. As any layer depending on the events, a Load Data button will appear at the bottom of the layer tag. Click it to extract the vehicles’ positions from the events.

 

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”.

 

  Benchmark

Download Benchmark ZIP, ca. 35MB

More information about the MATSim Benchmark.