1 写node.xml 和edge.xml 并生成net文件
netconvert --node-files=node.xml --edge-files=line.xml --output-file=idea.net.xml
2 随机车流 rou文件
先输入python randomTrips.py -n idea.net.xml -e 50 -p 0.1 -l 生成车辆到50s 每0.1S生成1辆车
再输入python randomTrips.py -n idea.net.xml -r idea.rou.xml -e 50 -p 0.1 -l
注意实现必须要在py文件的路径下cmd,并且net文件也在该路径下
3 sumo.cfg文件
<configuration>
<input>
<net-file value="intersection.net.xml"/>
<route-files value="intersection.rou.xml"/>
</input>
<time>
<begin value="0"/>
<end value="1000"/>
<step-length value="0.1"/>
</time>
<reports>
<print-options value="false"/>
</reports>
<gui_only>
<start value="true"/>
</gui_only>
</configuration>
4 打开sumo-gui 模拟
先导入net文件,在导入config文件

2046

被折叠的 条评论
为什么被折叠?



