1. routing by effort is only effort (so the value is 3), however, the
travel time is still tracked because you might have defined different
effort for different times (i.e. the time to travel by train depends on the
schedule and thus waiting time).
2. no.
3. yes. By launching multiple instances of sumo and switching between them.
See
https://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html#controlling_parallel_simulations_from_the_same_traci_script

Note, that you should achieve a huge speedup in the setEffort part if you
use libsumo (https://sumo.dlr.de/docs/Libsumo.html) though this precludes
having parallel instances in a single python process.

Am Do., 1. Juni 2023 um 08:03 Uhr schrieb 최석환 <[email protected]>:

> Hello all,
>
> I'm going to specify effort on all edges and reroute the vehicle according
> to effort every 5 minutes.
> My code is as follows.
>
> ----------------------------------------------------------------------------------------------------------------------
> net = sumolib.net.readNet('osm.net.xml')
> edges = net.getEdges()
> step = 0
> while step < 86400:
>         traci.simulationStep()
>
>         if traci.simulation.getTime() % 300 == 0:
>             for edge in edges:
>                 if traci.edge.getTraveltime(edge.getID()) > 1000:
>                     if edge.getID() in clist:
>                         traci.edge.setEffort(edge.getID(),
> (edge.getSpeed()*0.7) / (edge.getLength()+edge.getLength()*4*0.06), step,
> step + 300)
>                     else:
>                         traci.edge.setEffort(edge.getID(),
> (edge.getSpeed()*0.7) / edge.getLength(), step, step + 300)
>                 else:
>                     if edge.getID() in clist:
>                         traci.edge.setEffort(edge.getID(),
> traci.edge.getTraveltime(edge.getID())+edge.getLength()*4*0.06, step,
> step+300)
>                     else:
>                         traci.edge.setEffort(edge.getID(),
> traci.edge.getTraveltime(edge.getID()), step, step+300)
>                 for vehId in traci.simulation.getDepartedIDList():
>                     traci.vehicle.setEffort(vehId, edge.getID(),
> traci.edge.getEffort(edge.getID(), step))
>
>
>             for vehId in traci.vehicle.getIDList():
>                 traci.vehicle.rerouteEffort(vehId)
>
>         step += 1
>
> traci.close()
>
> --------------------------------------------------------------------------------------------------------------------
> My network has 6400 edges and the traffic demand is 40,000 per hour.
> This takes a very long time in the traci.vehicle.setEffort part.
>
> The questions I'm curious about are as follows.
> 1. I wonder if reroute by effort is only effort or travel time and effort,
> for example, if the effort is 3 and travel time is 9, the value used 3 or
> 12?
> 2. Is it possible to reroute based on the effort set in traci with routing
> settings in the .sumocfg file for more threads?
> 3. Is parallel processing possible in python using traci if effort-based
> rerouting is not available in .sumocfg?
>
> Thank you reading my mail.
>
> SeokHwan
> _______________________________________________
> sumo-user mailing list
> [email protected]
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to