1.使用netedit构建路网,由gneE0,gneE1,gneE2,gneE3四个路段构成,保存为abc.net.xml;
2.构建车流文件abc.rou.xml, 下面代码每隔9毫秒产生等距离车流;
<routes>
<vType id="type1" accel="0.8" decel="4.5" sigma="0.5" length="5" maxSpeed="50"/>
<flow id="type1" color="1,1,0" begin="0" end= "720" period="9" type="type1">
<route edges="gneE0 gneE1 gneE2 gneE3"/>
</flow>
</routes>
3.构建仿真所需要的配置文件,abc.sumocfg;
<configuration>
<input>
<net-file value="abc.net.xml"/>
<route-files value="abc.rou.xml"/>
</input>
</configuration>
4.使用sumo-gui大开abc.sumocfg文件观看仿真,效果如下;
6.修改构车流文件abc.rou.xml, 下面代码产生随机车流;
<routes>
<vType id="type1" accel="0.8" decel="4.5" sigma="0.5" length="5" maxSpeed="50"/>
<flow id="type1" color="1,1,0" begin="0" end= "720" period="0.1" type="type1">
<route edges="gneE0 gneE1 gneE2 gneE3"/>
</flow>
</routes>
7.随机车流效果如下: