Thank you so much Jacob. I tried two different approaches:
1- using oneShot, which I found very efficient and fast as vehicles reroute every 30 sec (running one_shot_30.sumocfg), with these confs
<configuration>
<files>
<net-file value="map10_limitedWellington.net.xml"/>
<route-files value="mapv12018_p41400_e600lw_000OS.rou.xml"/>
<vehroutes value="vehroutes_30.xml"/>
<summary value="summary_30.xml"/>
<tripinfo value="tripinfo_30.xml"/>
<additional-files value="dump_30.add.xml"/>
</files>
<process>
<begin value="0"/>
<route-steps value="200"/>
<routing-algorithm value="astar"/>
<device.rerouting.probability value="1"/>
<device.rerouting.period value="30"/>
<device.rerouting.adaptation-interval value="1"/>
<device.rerouting.with-taz value="False"/>
<device.rerouting.explicit value=""/>
<vehroute-output.last-route value="False"/>
<vehroute-output.exit-times value="False"/>
<vehroute-output.sorted value="False"/>
</process>
<reports>
<verbose value="True"/>
<no-warnings value="True"/>
</reports>
</configuration>
2. In my simulation environment, there is no need that all vehicle reroute every 30 sec, so I switched to Traci and wrote the following simple python codes, which it gets very slow at 30 sec intervals. Could you please advise what I need to focus on to speed up the simulation.
def run():
step = 0
simtime=0
while traci.simulation.getMinExpectedNumber() > 0:
simtime=traci.simulation.getCurrentTime()
if simtime % 30000 == 0:
aa=traci.vehicle.getIDList()
for veh_id in aa:
traci.vehicle.rerouteTraveltime(veh_id,True)
traci.simulationStep()
traci.close()
with these confs
<configuration >
<input>
<net-file value="map10_limitedWellington.net.xml"/>
<route-files value="mapv12018_p41400_e600lw_000OS.rou.xml"/>
<vehroutes value="vehroutes_30.xml"/>
<summary value="summary_30.xml"/>
<tripinfo value="tripinfo_30.xml"/>
<additional-files value="dump_30.add.xml"/>
</input>
<process>
<begin value="0"/>
<route-steps value="200"/>
<routing-algorithm value="astar"/>
<device.rerouting.probability value="1"/>
<!--<device.rerouting.period value="30"/>-->
<device.rerouting.adaptation-interval value="1"/>
<device.rerouting.with-taz value="False"/>
<device.rerouting.explicit value=""/>
<vehroute-output.last-route value="False"/>
<vehroute-output.exit-times value="False"/>
<vehroute-output.sorted value="False"/>
</process>
</configuration>
- When rerouting with the rerouting device the travel time
always comes from another data storage which is updated continuously
with a configurable averaging procedure. The parameters for this updating strategy are user definable. It is also possible to set the device travel time directly via TraCI.
- When using the TraCI method rerouteTraveltime from the python TraCI library, the command supports an additional boolean parameter currentTravelTime (default True). When this parameter is set to True,
the global edge weights are replaced by to the currently measured
travel times before rerouting. To replicate this behavior with other
TraCI clients, all edges in the network must be called with change global travel time information using the value of current travel time.
Note that the travel time values which are set in this way are used for
the full duration of the simulation unless updated again.
Many thanks
Mohsen
On Tuesday, August 14, 2018, 9:06:12 PM GMT+12, Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote: