Sumo生成數據


1.生成input_net.net.xml文件

參數解釋:http://www.sumo.dlr.de/userdoc/NETGENERATE.html#Grid_Network

1).生成grid network

F:/Tools/sumo-0.24.0/bin/netgenerate --grid --grid.number=5 --grid.length=1000 -L 5 --output-file=input_net.net.xml --no-internal-links true -j traffic_light -S 20

  該命令生成了各方向均有5個節點的網絡,其中每一段路的長度為1000m,有5個車道,默認車速為20m/s,路的交匯處有交通信號燈。

F:/Tools/sumo-0.24.0/bin/netgenerate --grid --grid.x-number=5 --grid.y-number=6 --grid.y-length=1000 --grid.x-length=800 -L 4 -S 12 --output-file=input_net.net.xml    

  該命令生成了x方向有5個節點,每段路的長度為800m;y方向有6個節點,每段路的長度為1000m。每段路有4個車道,默認車速為12m/s。

2).生成random network

F:/Tools/sumo-0.24.0/bin/netgenerate --rand -o input_net.net.xml --rand.iterations=200

 

2.生成旅行信息trips.trips.xml

參數解釋:http://www.sumo.dlr.de/userdoc/Tools/Trip.html#randomTrips.py

python F:/Tools/sumo-0.24.0/tools/randomTrips.py -n input_net.net.xml -e 10 -p 0.01

  該命令表示,旅行信息在0-10秒內生成,每0.01秒生成一個軌跡。

python F:/Tools/sumo-0.24.0/tools/randomTrips.py -n input_net.net.xml -e 10 -p 0.2 --trip-attributes="departLane=\"best\""

  該命令表示,旅行信息在0-10秒內生成,每0.2秒生成一個軌跡,且開始的車道為“best”

  關於departLane等參數的具體解釋:http://www.sumo.dlr.de/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html

 

3.生成路徑信息routes.rou.xml

官方解釋:http://www.sumo.dlr.de/userdoc/DUAROUTER.html

F:/Tools/sumo-0.24.0/bin/duarouter --trip-files=trips.trips.xml --net-file=input_net.net.xml --begin=0 --end=12000 --output-file=routes.rou.xml 

F:/Tools/sumo-0.24.0/bin/duarouter --trip-files=trips.trips.xml --net-file=input_net.net.xml --additional-files=type.add.xml --begin=0 --end=600 --output-file=routes.rou.xml

 

4.生成仿真軌跡信息fcdoutput.xml
F:/Tools/sumo-0.24.0/bin/sumo -c cfg.sumocfg --fcd-output fcdoutput.xml

cfg.sumocfg:

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 
 3 <configuration>
 4 
 5     <input>
 6         <net-file value="input_net.net.xml"/>
 7         <route-files value="routes.rou.xml"/>
 8     </input>
 9 
10     <time>
11         <begin value="0"/>
12         <end value="600"/>
13     </time>
14 
15 </configuration>

 

5.osm文件轉換成net.xml

F:/Tools/sumo-0.24.0/bin/netconvert --osm-files map.osm.xml -o map.net.xml

在將osm文件轉換為net.xml文件的過程中,有可能會遇到大量相鄰的交點,可采用--junctions.join true進行合並。

對於某些速度較低的路段,可以使用--keep-edges.min-speed <FLOAT> 去除這些路段。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM