Skip to content

Step by step guide to run SimMobilityLT

chetan edited this page Jan 14, 2021 · 1 revision

Introduction

This is the steps to follow to get the code, libraries, compile it and run it.

Getting the libraries

From an Ubuntu console, type:

        sudo apt-get install libtinyxml-dev     \
                             libboost-all-dev   \
                             libpq-dev          \
                             xsdcxx             \
                             liblua5.2-dev      \
                             g++                \
                             cmake              \
                             libcppunit-dev     \
                             libjsoncpp-dev     \
                             libglpk-dev        \
                             libsoci-dev        \
                             git                \
                             libssl-dev         \
                             libxerces-c-dev    \
                             postgresql         \
                             postgresql-contrib \
                             postgresql-client-common \
                             libproj-dev \
                             libxml2 \
                             lcov \
                             liblapack-dev \
                             libblas-dev \
                             libarmadillo-dev

Getting the source code

  • On the terminal in your 'Documents' folder, type:
    git clone https://github.com/smart-fm/simmobility.git

  • Key in your github username and password. Talk to your manager about access rights

Compile the code

  • On the terminal, nagivate to simmobility/dev/Basic/
  • Type:
     mkdir Debug   [to be done only once]
     cd Debug
     cmake ../ -DCMAKE_BUILD_TYPE:STRING=Release \
               -DBUILD_SHORT:BOOL=OFF            \
               -DBUILD_MEDIUM:BOOL=OFF           \
               -DBUILD_LONG:BOOL=ON              \
               -DBUILD_TESTS:BOOL=OFF            \
               -DBUILD_TESTS_LONG:BOOL=OFF.      \
               -DBUILD_TOOLS=ON
    make -j8
  • Run the database password obfuscation tool
./ObfuscatePassword YOUR_POSTGRES_DATABASE_PASSWORD
  • Note down the obfuscated password

  • Navigate to simmobility/dev/Basic/private and create this file:

fm_local.cred
       {
         "username" : "USERNAME",
         "password" : "YOUR_POSTGRES_OBFUSCATED_PASSWORD",
         "algorithm" : ["cipher","xor23","clear"]
       }

Editing the settings

There are 2 ways you can modify the setting:

1. Modify the XML file directly

  • This should be for experienced users only. You can directly modify simrun_LongTerm.xml file in the Basic/data folder. Not much explanation needed here.

2. Using a python script to generate the XML file for you

  • Navigate to simmobility/dev/Basic/data and edit the Simrun_Longterm.csv using whichever program you wish (e.g. excel, google sheet, libreoffice calc..)
  • Edit the files as you wish
    • As a user, you only want to modify the "default" column only
    • The first row in the CSV file contain the headers:
header description
rowNo The row number determines the order which the variable will appear in. The number should all be filled and be in order, otherwise the python script will complain and things might break.
tag1 to tag5 The group in which the variable exist within
variable The name of the variable
description Describes what the variable does
visible A boolean that determines if the variable should exist in SimMobility UI (for UI developers)
tab_name A string that determines under which tab should the variable appear in SimMobility UI (for UI developers)
unit_type The type of value the unit should be in
default The default value the variable should have.
ui_name A string that determines under what name should the variable be in for the SimMobility UI (for UI developers)
comment Optional descriptions that will not appear anywhere (This is mainly used by developers to communicate with one another)
  • On the terminal, navigate to simmobility/dev/Basic/scripts/python
  • Run the following commands:
python csvtoxml.py
python csvtomd.py
  • Two files should be generated:
    • simrun_LongTerm_gen.xml in simmobility/dev/Basic/data
    • readme.md in simmobility/dev/Basic
      • The readme file is meant for users to read up on the variables in a readable format.
  • Now navigate to simmobility/dev/Basic/data and make a backup of "simrun_LongTerm.xml" and rename "simrun_LongTerm_gen.xml" to "simrun_LongTerm.xml"

Run Simmobility Long Term

  • On the terminal from the 'Basic' folder, type:
     Debug/SimMobility_Long data/simrun_LongTerm.xml data/simulation.xml
Clone this wiki locally