Subsections


4 Advanced topics

In contrast with the tutorials, the advanced topics will explain how to use the simulator to a fuller extend. Many topics are very useful for professional studies. The Principles of operation in Sec. 5.1 are not fundamental for the usage of the simulator, but may help to get a deeper understanding.


4.1 Add users according to a predefined origin-to-destination matrix

The evaluation of any planned transportation system starts usually with an origin-to-destination matrix (ODM). From this matrix we know how many passengers want to travel from and to a specific place in a certain time window (usually during peak hours). There are planning-methods that allow to get from the ODM (together with other data on street-layouts and geographical data) to a transportation-network layout with nodes, links and stations, where the links and station must have certain capacities in order to cope with the expected flow of vehicles and passengers. However, note that PRT/GRT networks have some special properties such as off-line stops. Usually the first layout is based on static flow averages, which is a crude, but useful assumption.

In any case, one would start with an initial topology and then verify with the micro-simulator whether the respective performance satisfies our expectations. If not, bottle-nags need to be identified and the topology modified accordingly.

Here, we explain how to use iTS MAITfor this iterative optimization process, in particular on how to include a predefined ODM in a network layout.

  1. Design of initial network: In order to simulate a transportation network with a specific ODM, you obviously need to design the network first. Follow the steps in Sec. 3.3 up to the point where you have saved the simulation with carriers, for example under the name mycity_cars.its.

  2. Prepare file with the ODM data: The required ODM file is an ordinary text-file with a comma-separated table:


        ,SN1,SN2,SN3,SN4,SN5,SN6,SN7,SN8
    SN1,P11,P12,P13,P14,P15,P16,P17,P18
    SN2,P21,P22,P23,P24,P25,P26,P27,P28
    SN3,P31,P32,P33,P34,P35,P36,P37,P38
    SN4,P41,P42,P43,P44,P45,P46,P47,P48
    SN5,P51,P52,P53,P54,P55,P56,P57,P58
    SN6,P61,P62,P63,P64,P65,P66,P67,P68
    SN7,P71,P72,P73,P74,P75,P76,P77,P78
    SN8,P81,P82,P83,P84,P85,P86,P87,P88



    In this case we have 8 stops, with names SN1$ \ldots$ SN8. These are the stop names that you have inserted at the control-panel of each stop. If not, do so by selecting Edit/ Module/ Control-panel; clicking on the stop on the canvas you want to give a name; choose the Parameters Tab at the control-panel, fill in the Name field AND HIT THE RETURN KEY to take over the value. 2By default the stop-names are unique numbers ( $ 1,2,3,\ldots$ ). During the simulation Pmn passengers will travel from stop with name SNm to the stop with name SNn. You can find an example ODM file under projects/fiera_odm.txt

    You may have the ODM data already available in electronic form, in a spreadsheet for example. In this case, just save it as comma separated text file and you are done.

  3. Add users to simulation: Now we want to add the users to the already existing simulation, containing track and vehicles. Open the simulation into iTS MAIT(for example fiera_cars.its). Open the module browser with Edit/ Module/ Add... and select group ``users''. Select the ``generic'' user-type and click on the Add multiple bottom. Then a dialog window shows up with the following options:
    File with O/D matrix
    Insert path of ODM file or select the file using the file browser.
    Start trip earliest,Start trip latest
    These two fields specify the time-interval in seconds when the trip of the users must start. The actual start of the trip of a particular user will be picket from this interval (using uniform distribution).
    Minimum boarding time, Maximum boarding time
    These two fields specify the boarding time-interval. The actual boarding time of a particular user will be picket from this interval (using uniform distribution).
    Minimum exit time, Maximum exit time
    These two fields specify the exit time-interval. The actual exit time of a particular user will be picket from this interval (using uniform distribution).
    Aura
    : This is simply the diameter of the dot of the 2D representation of this user-type.
    Color
    : By clicking on ``Pick...'' you can select the color of the 2D representation of this user type.
    Load user-profile, Save user-profile
    : You can save and reload the above parameters in as user-profile.

  4. Press ``OK''.

With the above user-parameters you can simulate different user-types, as for example single adults, passengers with luggage or a user-group such as a family. In the latter case one user stands for the entire group.

Users of several user-types (with different ODMs) can be added sequentially by repeated applying the Edit/ Module/ Add... process.

Note that during the start trip time-interval, all passengers in the ODM matrix will start the trip. This means Pmn passengers will start the trip from stop with name SNm to the stop with name SNn from time Start trip earliest to Start trip latest.

Note that you will not see any user on the display unless the simulation time passes the time defined in Start trip earliest. Then users will start queuing up at the stop of their origin.


4.2 Scripting

Scripting is a powerful feature in order to automatize the process of an entire series of simulations. The simulator itself is written in Python which is a object-oriented script language. For this reason, it is straight forward to access most simulator internal variables and functions via a script.

You would use scripts without graphical interface for large scale simulations because:

A full description on what can be done with scripts would result in a manual by itself. Instead, there are some example scripts in the main directory that you can execute just as the main program. Python is an extremely clean language and you are invited to use the examples as a template which can copied and modified for your specific purposes. The simplest script is called script_users. It runs the simulation of the same transportation network with different number of users. script_odms is slightly more complicated as it automatically simulates the same network with a different number of vehicles, using different origin-to-destination matrices.

In order to view/modify the script, open it in a text editor (possibly with python syntax highlighting, such as emacs). The MS-windows distribution of Python contains already an appropriate editor called IDLE: Just right-click on the script file and select edit with IDLE. With IDLE you can also run the scrip: select menu item Run / Module.


4.3 The command-line mode

With the command-line mode you can run a simulation without graphical interface and animations. You will appreciate this simulation mode if you want to simulate a large network with many vehicles and passengers because:

Assumed you have edited a network, added vehicles and users and saved the simulation under mycity_users.its. Now you want to run the simulation for 1h, save the simulation afterward in file mycity_1h.its and a report of the results in file mycity_1h.txt. To do all this with just one command: open a terminal (or DOS-prompt under windows) and type:
python its.py -c -e3600 -o projects/mycity_1h.its -r projects/mycity_1h.txt
    projects/mycity_users.its

If no simulation time is given (-d or -e) option then the simulation internal times are used as set in the menu Simulation / Parameters. If you do not trust what has happened during the command-line simulation, you can always have a look at the result by opening the output simulation file (hereprojects/mycity_1h.its ) in the simulator.

Have also a look at other command-line options. For example with the -d combined with the -f option, one can iteratively advance the simulation by a given amount of time and save the output simulation file back into the input simulation file. In this example the simulation mycity.its is advanced by 1 minute each time the following command line is executed.
python its.py -c -d60 -f projects/mycity_users.its

The currently available command-line options can be retrieved with the command line python its.py -h.

Note: under MS-windows the command-line mode is painful because the standard DOS-prompt shell is not very sophisticated. You also need to add the python.exe in the application search path and you need to give the absolute path of the simulation and output file. Recommendation: better use scripting under windows.


4.4 How to simulate failures

Here is how you can simulate the most important failure: a vehicle stops moving on the track:
  1. Open a complete simulation, including vehicles and users. You may also run the simulation for a certain time to bring the network in a realistic state. Then stop the simulation at the time when you want to simulate the vehicle breakdown.
  2. Select Edit / ModulesControl-panel.
  3. Click on a track-element, where you want to simulate the breakdown and select the ``Sections'' tab.
  4. Select a Section of the Sections table where you want to simulate the event: On simple line or flexible line elements, there is just one section. On diverge elements, the first section is the input-sections, the others are output. On a merge-element, the first two elements are the input section, the last one is the output-section.
  5. Click into the ``Line speed'' field and change it to zero, or a small value AND HIT THE RETURN BOTTOM, otherwise the new value will not be effective. Click on the Update-bottom to see if the new values have been registered. You can leave the control-panel open for further interaction.
  6. Continue the simulation and watch how the vehicles are slowing down on the selected section.
  7. After a certain simulation time (which is necessary to repair or remove the vehicle), stop the simulation again and use the above described method to restore the line-speed to its old value.


4.5 3D OpenGL monitor

This is only a very crude 3D visualizer, but it is in real-time. When sitting on a vehicle one can get a kind of feeling for what would happen on a real ride. This applies only to smaller networks (a few km) and only with a small number of users. Unfortunately, the OpenGL monitor is currently not integrated in the main GUI as it requires a different scheduler. You can double-click on its3d to see a demo test-track. However, to view your own network is a bit more complex.

Here is the way to view your own network in 3D:

  1. Edit a simulation in 2D as described in Sec. 3.3, including vehicles and users.
  2. Save the simulation.
  3. Right-click on the script file ``its3d'' in the main directory and select edit with IDLE.
  4. Look at the script file. After the Usage info you will find a section ``DEFINE DEFAULTS HERE''.
  5. change the variable
    \begin{verb}
simfile_name
\end{verb}
    to the filename of your simulation.
  6. Use Run / Module or press F5 to start the scene. After saving your changes, you can also quit and run the 3d monitor by a double-click on its3d, because now the default simulation is your network.

Here is how to use the monitor:

    Initially you will see the network from above in observer mode.
    You have the following function-keys:

    Key      Function
    r        switch to observer external observer mode.
    u        sit on first vehicle
    b        move with first vehicle but below the guideway
    s        stop simulation
    c        continue simulation
    Esc      Quit application

    The following navigation keys are only valid for observer mode.
    8        move forward
    2        move backward
    6        move right
    4        move left
    9        move in
    3        move out
    To rotate around z and y axes: double-klick in 3D window and move mouse
    while keeping left mouse-button pressed.

Tip: Use the Number-block on your key-board to navigate.

Joerg Schweizer 2007-07-17