Setting up your IDE to use MARS-DSL

Before opening your first MARS project, please make sure the following are installed on your system:

  1. .Net Core: https://dotnet.microsoft.com/download
    • Select operating system
    • Click “Download .NET Core SDK” and follow installation instructions
  2. Java SDK: https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html
    • For macOS, download the .dmg installer file
    • For Windows, download the .exe installer file
    • Follow installation instructions
  3. Eclipse: https://www.eclipse.org/downloads/packages/
    • Download “Eclipse IDE for Java Developers” for your operating system
  4. Download MARS plugin for Eclipse:
    • Open Eclipse
    • Go to Help -> Install New Software…
    • In the “Work With” line, enter https://mars.haw-hamburg.de/mars-dsl/ and press the Enter key
    • “MARS DSL” should appear in the list below. Select it, click “Next”, and follow the installation instructions
    • On the bottom right of the Eclipse window, the installation process can be seen. Please wait for the installation to complete and address any popups that might occur in the process.
    • When the installation completes, restart Eclipse.

Setting up and running your first model

  1. Start Eclipse
  2. Click Help -> Check for Updates to make sure your MARS DSL plugin is up-to-date
  3. Open a new MARS DSL project: File -> New -> Project and select MARS -> MARS DSL Project
  4. Assign a name for your project and click Finish
  5. A new MARS project has two folders:
    • ‘src’ contains a file .mars in which you can write all your code for your model
    • ‘src-gen’ contains various configuration files associated with your project
  6. Feel free to use the MARS Modeling Handbook as a guide while writing your model
  7. In order to be able to run your model, a config.json file must be present in the project’s ‘src-gen’ folder. You can obtain a template file here.
  8. To run your model:
    • Open a command shell
    • Navigate to the ‘src-gen’ folder of your project
    • Enter ‘dotnet run -sm .json -project .csproj
  9. The simulation run will produce one .csv file (in the project’s ‘src-gen’ folder) for each agent defined in your model. These files incorporate one row per agent and tick and can easily be analyzed and visualized by Excel, R, or Python code.
    • Note: if you want to keep a run’s .csv files, make sure to move them out of the ‘src-gen’ folder before running another simulation. Otherwise, the .csv files from the previous run will be overwritten by the new run’s .csv files.

To check out some model examples, please check out our Git repository.