在sumo中绘制地图,然后利用sumo中的randomTrips.py工具产生随机的车流量
一、首先绘制路网,本文绘制了一个九宫格路网(myroad.net.xml),如下图:
二、在sumo/bin 目录下打开start-command-line.bat,进入到myroad.net.xml路径下,如下
三、生成rou.xml文件
先输入python d:/sim/sumo-1.2.0/tools/randomTrips.py -n myroad.net.xml -e 50 -l
再输入d:/sim/sumo-1.2.0/tools/randomTrips.py -n myroad.net.xml -r myroad.rou.xml -e 50 -l
运行成功后生成myroad.rou.xml文件,如下;
四、编辑sumo.cfg文件,如下
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
<input>
<net-file value="myroad.net.xml"/>
<route-files value="myroad.rou.xml"/>
</input>
<time>
<begin value="0"/>
<end value="1000"/>
</time>
</configuration>
五、运行程序