Simulate traffic using OpenStreetMap-data and SUMO- Simulation for Urban MObility.
โพสต์โดย jinalfoflia เมื่อ 7 สิงหาคม 2015 ในภาษา EnglishSUMO is a free and open traffic simulation suite which is available since 2001. SUMO allows modelling of intermodal traffic systems including road vehicles, public transport and pedestrians.
- This simulator has many options to customise the simulation, options like CO2 emissions on roads, speed limits of the roads etc
- The data for simulation is taken from the OpenStreetMap
Some useful links to help installation of SUMO simulator for
Steps to simulate traffic of a particular region.
Step 1: Download OSM data from Open Street Maps (<file_name>.osm
)
Step 2: Run this command to get the .net file required for simulation. (Netconvert imports digital road networks from different sources and generates road networks that can be used by other tools from this package.)
netconvert --osm-files <file_name>.osm -o <file_name>.net.xml --output.street-names true --output.original-names true
Step 3: From the following link copy the additional polygons structures
http://sumo.dlr.de/wiki/Networks/Import/OpenStreetMap
Step 4: Save the data into a file and name it as ‘typemap.xml’ then run the following command. (Polyconvert imports geometrical shapes (polygons or points of interest) from different sources, converts them to a representation that may be visualized using SUMO-GUI)
polyconvert --net-file <file_name>.net.xml --osm-files <file_name>.osm --type-file typemap.xml -o <file_name>.poly.xml
python /Applications/sumo-0.23.0/tools/trip/randomTrips.py -n <file_name>.net.xml -e 100 -l
python /Applications/sumo-0.23.0/tools/trip/randomTrips.py -n <file_name>.net.xml -r <file_name>.rou.xml -e 100 -l
- After the above steps, the routes have been generated, in the xml file you need to configure the file for the SUMO gui
Step 5: Search for the sumo.cfg file in the sumo folder and copy it to your working folder.
The configuration file should be modified with the following contents:
</input>Step 6: To run the simulator
sumo-gui <file_name>.sumo.cfg
Outcome
- Helps one understand how each tag that we use impacts the traffic.
- Helps in, in-depth analysis of the road network that’s established by the OSM data.
- It by default simulates right-hand driving traffic conventions and has no options for left-hand driving conventions.
For more questions.
การอภิปราย
ความคิดเห็นจาก pratikyadav เมื่อ 7 สิงหาคม 2015 เมื่อเวลา 07:09 น.
great writeup
ความคิดเห็นจาก !i! เมื่อ 7 สิงหาคม 2015 เมื่อเวลา 07:25 น.
Thanks for sharing! I just did some experiments with the eWorld frontend and OSM. But wasn’t that amazing :-) osm.wiki/Simulators
ความคิดเห็นจาก onion เมื่อ 7 สิงหาคม 2015 เมื่อเวลา 07:57 น.
Can you simulate buss traffic from osm buss routes ?
ความคิดเห็นจาก jinalfoflia เมื่อ 7 สิงหาคม 2015 เมื่อเวลา 08:25 น.
@pratikyadav Thanks!
@!i! Oh! Seems interesting, will surely check that out. Thank you!
@onion I haven’t tried it though, it seems to be possible to simulate bus traffic from OSM bus routes.
ความคิดเห็นจาก !i! เมื่อ 7 สิงหาคม 2015 เมื่อเวลา 08:59 น.
I would be interested to know, if SUMO can benefit from alle the POIs that we tag at OSM? For example can a school be detected and used within the simulation? (e.g. n % of parents drive to school during 6:00…7:00am?)
ความคิดเห็นจาก PlaneMad เมื่อ 7 สิงหาคม 2015 เมื่อเวลา 12:07 น.
Looks very interesting Jinal. Also found some more tutorials that could come in handy to learn how this can be used in some real world scenarios. Pretty cool software!
ความคิดเห็นจาก jinalfoflia เมื่อ 10 สิงหาคม 2015 เมื่อเวลา 09:08 น.
@!i! We can add the POIs by using the additional polygons, but i’m uncertain about the simulator detecting it.
We can manually simulate the area around the required POIs. (for eg. School, this can be done with some approximate numbers as to n% of parents , one can simulate the traffic scenario near a school and predict some improvements accordingly)
@PlaneMad Thank you for the tutorials!
ความคิดเห็นจาก KVLA-HRO-Mei เมื่อ 14 สิงหาคม 2015 เมื่อเวลา 07:11 น.
@jinalfoflia Thanks for the answer. I’m not sure, but if I remember correctly, than eWorld is able to synthesize such polygons automaticaly. Also they feature to add e.g. weather anomalies etc. But to be honest, I have no idea about the realism of such enriched simulations ;-)
ความคิดเห็นจาก bob_sim เมื่อ 18 สิงหาคม 2015 เมื่อเวลา 19:29 น.
Good introduction to SUMO. In your NetCONVERT-Command, you can use ‘–tls-join true’ to prevent SUMO from having red-light-stop-positions in the middel of your junction, making the traffic-flow collapse very fast.
Look for the right additional configuration here: http://sumo.dlr.de/wiki/NETCONVERT#Configuration
ความคิดเห็นจาก jinalfoflia เมื่อ 20 สิงหาคม 2015 เมื่อเวลา 11:11 น.
@KVLA-HRO-Mei I’ll surely check out eWorld. Thank you :)
@bob_sim This was really helpful, will surely try it to make simulation better. Thank you.
ความคิดเห็นจาก Baloo Uriza เมื่อ 28 สิงหาคม 2015 เมื่อเวลา 18:47 น.
OK, this is a total pisser from a Debian perspective…can’t seem to get traffic generated.
ความคิดเห็นจาก habib_tum เมื่อ 14 ตุลาคม 2015 เมื่อเวลา 14:52 น.
I have followed the above process and trying to generate random route using osm.map. my system variable is set for python.I used manual path for randomTrips.py in windows 7 following the above.
current_dir>python D:\source\sumo-0.21.0\tools\trip\randomTrips.py -n gerching.net.xml -e 100 -l
the above line worked and created trips.trips xml file. i have following files now in current_dir: gerching.net gerching.osm gerching.poly typemap trips.trips
current_dir>python D:\source\sumo-0.21.0\tools\trip\randomTrips.py -n gerching.net.xml -r gerching.rou.xml -e 100 -l calling D:\source\sumo-0.21.0\tools\trip....\bin\duarouter -n gerching.net.xm l -t trips.trips.xml -o gerching.rou.xml –ignore-errors –begin 0 –end 50.0 – no-step-log Traceback (most recent call last): File “D:\source\sumo-0.21.0\tools\trip\randomTrips.py”, line 209, in main(get_options()) File "D:\source\sumo-0.21.0\tools\trip\randomTrips.py", line 205, in main subprocess.call(args) File "C:\Python27\lib\subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait() File "C:\Python27\lib\subprocess.py", line 710, in __init__ errread, errwrite) File "C:\Python27\lib\subprocess.py", line 958, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified
It does not create any file for the above command. How to solve it? Thanks in advance
ความคิดเห็นจาก Ankita Mithaiwala เมื่อ 2 ธันวาคม 2015 เมื่อเวลา 08:20 น.
I m getting error when i run python command. The error like this: Traceback (most recent call last): File “/home/ankita/Downloads/sumo-0.12.3/tools/trip/randomTrips.py”, line 49, in net = sumonet.readNet(options.netfile) File "/home/ankita/Downloads/sumo-0.12.3/tools/trip/../lib/sumonet.py", line 447, in readNet parser.parse(filename) File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.7/xml/sax/expatreader.py", line 210, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.7/xml/sax/expatreader.py", line 304, in start_element self._cont_handler.startElement(name, AttributesImpl(attrs)) File "/home/ankita/Downloads/sumo-0.12.3/tools/trip/../lib/sumonet.py", line 363, in startElement self._currentEdge = self._net.addEdge(attrs['id'], attrs['from'], attrs['to'], prio, attrs['function']) File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 316, in __getitem__ return self._attrs[name] KeyError: 'function' can u help me to solve this error? Thank u. Reply.
ความคิดเห็นจาก Ankita Mithaiwala เมื่อ 3 ธันวาคม 2015 เมื่อเวลา 14:29 น.
I m unable to find sumo.cfg in sumo folder. Can any one help me?? I m currently SUMO 0.23 version. Where search sumo.cfg file??
ความคิดเห็นจาก Ankita Mithaiwala เมื่อ 5 ธันวาคม 2015 เมื่อเวลา 05:56 น.
Please give me solution..
ความคิดเห็นจาก ben hassine Afef เมื่อ 30 พฤษภาคม 2016 เมื่อเวลา 17:51 น.
Hi, I try to install SUMO and when I type the command “netconvert” it is not identified by my cmd. Any A solution please .
ความคิดเห็นจาก bu_zyad เมื่อ 10 ตุลาคม 2016 เมื่อเวลา 09:39 น.
I got
netconvert –osm-files map.osm -o map.net.xml –output.street-names true –output.original-names true Error: Could not open osm-file ‘map.osm’. Error: No nodes loaded. Quitting (on error).
how to solve it?
ความคิดเห็นจาก bu_zyad เมื่อ 10 ตุลาคม 2016 เมื่อเวลา 09:40 น.
I got
netconvert –osm-files map.osm -o map.net.xml –output.street-names true –output.original-names true
Error: Could not open osm-file ‘map.osm’.
Error: No nodes loaded.
Quitting (on error).
how to solve it?
sorry it was missed up
ความคิดเห็นจาก RitaEnami เมื่อ 11 ธันวาคม 2016 เมื่อเวลา 18:55 น.
Thanks for sharing. Do you have any idea that how we can implement the GSM wireless traffic with SUMO?
ความคิดเห็นจาก khanali เมื่อ 11 มกราคม 2018 เมื่อเวลา 11:33 น.
Please help me.. i imported OSM Map to sumo and they correctly simulate means the vehicles runs correctly but i want to calculate vehicle start to end time during simulation from source to destination ??? so how i calculate vehicle trip time from source to destination ???