ppt的部分来自于youtube视频:https://www.youtube.com/watch?v=9MyIABer_NY&t=23s
sumo仿真文件包括两部分 第一部分是路网文件(net),第二部分是道路文件(route)
1. net文件的获取
(1) netedit中直接画
(2) 分别编写nod edge 和type文件,使用netconvert来生成 (这样的好处就是各元素的id一开始就很清楚,在编写route file或者 add file 的时候就很清楚)

(3)使用 (OSM) open source map 获得实际的路网数据
a. Google open street map select area and export (can't too big)
b. Convert the Map into SUMO Network
netconvert --osm-files map.osm -o test.net .xml
2. route file 包括了车辆信息和道路信息(需要手动来写)
(1)简单的道路文件 (所含车辆数较少)

(2) 利用RandomTrips.py 生成随机道路数据
在sumo的安装文件中找到 Sumo\ tools\randomTrips.py
copy randomTrips.py in your folder
python PATH\randomTrips.py -n test.net.xml -r test.rou.xml -e 50 -l
" #生成车的路径行为xml的脚本,
#每p个步长生成1个,
#binomial二项分布系数是8, 1的时候退化成伯努利分布,
#s是种子数,
#e结束时间,
#l是根据道路长度来划分权重, L是根据车道数划分权重, 我这里选的是l; " [1]
指令会生成(.rou.xml)和(.rou.xml)
3. 仿真文件 sumo Configuration file (手动编写)
(.sumocfg)

上述步骤完成可以获得一个基本完整的仿真文件,但如何利用traci接口来控制车辆且输出控制结果呢?
网友评论