2.1. Installing Software

2.1.1. Installing Java

MATSim is written in Java. To run java you need a JRE and to develop Java code you must install a JDK. An installer containing both can be downloaded for example at: download the Java Development Kit (JDK) from Oracle

In case you are not familiar with Java or other object oriented programming languages, we have put together some basics that might help you to get through Java parts of this tutorial here.

Note: You can check if Java is already installed on your machine by opening the command Prompt (Start --> Accessoires --> Command Prompt) and typing in java -version.

java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)

If you see something like the above, you already have Java installed on your machine.

2.1.2. Installing Eclipse

Most of the core MATSim developers use Ecplise as a software development environment. This tutorial is thus based on Ecplise although other environments could be used. We recommend the "Eclipse Classic" distribution. Download the newest version here.

In order to use eclipse you simply unpack the downloaded eclipse.zip file in a folder of your choice and start the programm by double clicking eclipse.exe.

2.1.3. Installing MATSim

We will work with Ecplise. Basically there are two ways of getting MATSim working in eclipse.

For committers (developers with their own playground in MATSim): You can find here a description for downloading the latest version of the source code using Subversion (svn) and Maven.

For non-committers (or nor-yet-committers): You can either download a jar file as an official release or as a nightly build. Just follow the procedure below.

For this tutorial we use the MATSim Spring 2012 release. The version number is 0.4.x, with 'x' being the number of latest official bugfix release. Make sure always to use the latest bugfix release. For reasons of simplicity, in the following we use the string "matsim-0.4.x" when the version number is referred to.

In order to access code and data, the Eclipse IDE is used instead of the command line. Take the following steps to install MATSim in Eclipse.

  • Download the current release (matsim-0.4.x.zip, replace x with the number of the bugfix release) from the sourceforge download page and save it on your desktop.
  • Unzip the file. A folder (matsim-0.4.x) is created.
  • Start Eclipse.
  • Start a new Java Project: Click File -> New -> Java Project
  • Deselect the "Use default location" checkbox
  • For the "Location", choose the unzipped matsim-0.4.x folder.
  • Make sure a JRE/JVM 6 is set in section JRE.
  • Click Next.
  • To make the MATSim source code visible in Eclipse do  the following:
    • In the "Java Settings" dialogue, click the Libraries tab.
    • In the JARs list, choose matsim-0.4.x-sources.jar and click Remove.
    • In the JARs list, choose matsim-0.4.x.jar and expand it.
    • Click Source attachment: (None), then click Edit....
    • Click Workspace....
    • Choose matsim-0.4.x/matsim-0.4.x-sources.jar, then click OK.
    • Click again OK to confirm the "Source Attachment Configuration" Dialog
  • Click Finish.

Congratulations! You have successfully installed MATSim for usage with Eclipse. The project can be found in the Package Explorer on the left side of the screen. You can now investigate the MATSim software project, e.g.

  • read the release notes (README.txt, CHANGELOG.txt)
  • conveniently browse the source code of MATSim (packages in Referenced Libraries - matsim-0.4.x.jar). For this, make sure that the package presentation is hierarchical: Click the small triangle at the top right of the Package Explorer, then choose Package presentation - Hierarchical.

2.1.4. Installing QGis

When starting to work with a new dataset that contains geographical data (e.g. coordinates), having a look at the data with a Geographic Information System (GIS) tool is often useful. In a later lesson, we will visualize traffic count stations and assign them to links in the network.

QGis is an Open Source GIS licensed under GNU General Public License. It runs on Windows, Linux as well as Mac OS.

Homepage: http://www.qgis.org/en.html

Download: http://www.qgis.org/wiki/Download

Please download and install the newest standalone version available for your OS. During the installation you can additionally select some sample dataset to be installed. We will not use them during our course, but if you want to start working this GIS tool, it might be a good idea to have some sample data to work with.

If you want to change the language settings oif your QGIS version, go to the menue Settings, click on Options... scroll down to Locale and tick the Override system locale checkbox. Then you can choose your language in the drop-down menu on the right.

2.1.5. Installing Google Earth

Some of MATSim's output data is given in the KML data format which can be visualized using Google Earth. You can download and install Google Earth from here. Uncheck the checkboxes concerning the use of Chrome if you don't want to install or make it you standard browser.

In order to install Google Earth you simply have to double click downloaded .exe file and follow the installation assistant. (Beware that an internet connection is required for installing and running Google Earth.

2.1.6. Installing a Text Editor With Syntax Highlighting

During this tutorial, you have to work quite often with text files, especially with xml files. Therefore, we recommend to use either the editor which is included in Eclipse or an external editor that supports syntax highlighting.

Some free examples are:

2.1.7. Installing 7-Zip

Since we are using several different compression formats (.zip, .gz, .bz2, etc.) you need a program that is able handle those formats. A convienient tool under windows is for example 7-Zip.

If you do not have a similar tool installed, download 7-Zip from the link above and install it using the installation wizard by double clicking on the .exe or .msi file recommended for your Windows version.

2.1.8. Installing the Visualizer

senozon, a private company in Switzerland working on and with MATSim, is developing a visualizer for MATSim. For this tutorial, we can use a feature-limited free version of the visualizer. You can download it from here. Note that you also have to generate a license-file on the same page to use the visualizer. The license-file will allow you to use the visualizer for up to 6 months.

After you downloaded the visualizer, unzip the downloaded file and start the application. On the first start, it will ask you for the license file, that you should have received by email.

If you want to test the visualizer at this point, you can use the sample data provided on the senozon download page and follow the instructions given here.