Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Routing algorithm

- using TraCI always slows down the simulation
- using traci.vehicle.rerouteTraveltime(veh_id,True) slows down the simulation a lot (due to updating of the edge weights)
- if you just want vehicles to pick a better route at insertion, you can simply load the trips and not set device.rerouting.period
- you can set the rerouting period for each vehicle individually using traci.vehicle.setParameter(vehID, "device.rerouting.period", str(periodInSeconds))

2018-08-15 10:52 GMT+02:00 mohsen hs <mohsenhs82@xxxxxxxxx>:
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>
 

I am following these from here:http://sumo.dlr.de/wiki/Simulation/Routing

  • 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:



2018-08-11 21:27 GMT+02:00 mohsen hs <mohsenhs82@xxxxxxxxx>:
Dear sumo users, 

I know that it is possible to assign weight to the routes (from http://sumo.dlr.de/wiki/ DUAROUTER), but this needs a file, which I do not have. Is there any way to create routes and use the number of lanes as a parameter for the route creation/selection? For example, if there are 10 different routes from a source and destination, then the algorithm picks streets with the highest number of lanes ( and length, which leads to higher capacity) rather than just picking one randomly? Or just alternatively, is there any way to make the route selection more intelligent by considering the congestion time that vehicles may face later in the simulation?


Many thanks
Mohsen

______________________________ _________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/ mailman/listinfo/sumo-user




Back to the top