Applicable Versions | NetSim Standard | NetSim Pro |
Applicable Releases | v11 | v12 | v13 |
This article discusses simulation of trains in NetSim VANET module using SUMO. To build an intermodal simulation scenario with trains, additional steps have to be taken in comparison to a plain vehicular simulation.
Railways can be imported from OSM. The OSM Web Wizard offers one of the easiest solutions to start with SUMO. Based on a selection of an openstreetmap map excerpt, you will be able to configure a randomized traffic demand and run and visualize the scenario in the SUMO-GUI.
Creating Railway Simulations using OSMWebWizard.py contains following steps:
- Software Requirements - NetSim, SUMO, Python (Python and SUMO are included in NetSim v11.1 and v12 installation set-ups)
- Sumo Path: "C:/sumo-0.32.0 or C:/ProgramFiles(x86)/Eclipse/Sumo
- Python - custom Path
- Configure and download Railway Network Configuration using OSMWebWizard.py tool
- Create a SUMO configuration file (*.sumo.cfg) file for performing simulations in SUMO and importing the network in NetSim.
- Simulate Railway Network Simulation using NetSim VANET Module
Steps for setting up SUMO:
Step 1: Go to Sumo installation directory --> Tools, double click on OSMWebWizard.py
Note: Ensure that Python is set as the default application for python (.py) files. If other editors are set as default application of python (.py) files, then you will have to Open Command Prompt window and change the current directory to "C:\SUMO0.32.0\tools" or "C:/ProgramFiles(x86)/Eclipse/Sumo " directory and execute the command
python osmWebWizard.py
Step 2: Choose a location on the OSM under Location or you can use your own location by clicking on Use Current Location. Make sure that the selected location has Railway Tracks
Step 3: Click on Vehicles and uncheck Cars and select Trains. Give appropriate values for Through Traffic Factor and Count with respect to your area selected
Step 4: Uncheck the Add Polygons under Options. Click on Generate Scenario
The scenario/ Railway Simulation network is now ready for the Sumo Simulation. Users can notice that automatically SUMO-GUI will open with the scenario that you have configured.
These files will be saved under C:/Users/<User name>/ SUMO with folder name as the system's current Date and Time.
Step 5: Now in order to interface with NetSim Copy the following files from the previously created folder:
- osm.net.xml
- osm.rail.trips.xml
- osm.view.xml
Step 6: Create a new folder and place the copied files into it.
Step 7: Create a sumo configuration file with the following format(Open Notepad and save it to Configuration.sumo.cfg in the same directory).
<configuration>
<input>
<net-file value="osm.net.xml"/>
<route-files value="osm.rail.trips.xml"/>
<gui-settings-file value="osm.view.xml"/>
</input>
<time>
<begin value="0"/>
<end value="1500"/>
<step-length value="0.4"/>
</time>
</configuration>
(Note:Users can change the end time value as per their need depending upon the Network Scenario that is created.)
Step 8: Now open NetSim--> New Simulation --> VANETS
- Select the SUMO config file that you have created for Railway simulation (Or Download the below attachment provided as an example Network)
- Connect the trains to Ad Hoc links and then create the application
- Change the Icon of Vehicle to Train, if required
- Run the Simulation
The attachment provided with this article is the example simulation file for Railway networks which contains Sumo Configuration files,
Additional reference:
https://sumo.dlr.de/wiki/Simulation/Railways
https://sumo.dlr.de/wiki/Tutorials/OSMWebWizard
Related articles: