sumo生成的车辆运动文件导入ns3的方法。

原文链接:http://sumo.dlr.de/wiki/Tutorials/Trace_File_Generation,详细叙述了相关的方法。


Generating a SUMO-trace

We assume You have the scenario and a configuration file named "myConfig.sumocfg". It may have a different name, of course. You should be able to start SUMO using Your configuration like this:

sumo -c myConfig.sumocfg

Now, we use the simulation to get an fcd output, a trace file in a SUMO-format. This file will be later converted into a trace file for one of the applications supported by Tools/TraceExporter. We generate an fcd output as following:

sumo -c myConfig.sumocfg --fcd-output sumoTrace.xml

And we will obtain the file "sumoTrace.xml".

Converting the Trace

We can now convert the vehicular traces in SUMO format into another format. For now, let's assume You would like to have a ns2 mobility file. We can generate one from the obtained fcd output using:

traceExporter.py --fcd-input sumoTrace.xml --ns2mobility-output ns2mobility.tcl

We obtain the file "ns2mobility.tcl", which we can give ns2 as input.


你可能感兴趣的:(ns3,sumo)