Thank you Jakob! I wish I had thought of that! Alas, I already implemented it with net.getShortestPath.

However, now that I've generated the 2000 route files, I am facing a similar problem with simulating each of them. I want to simulate each of them iteratively, without sumo re-loading the network each time. Is it possible?

Regards,
Chris

On Tue, 9 Mar, 2021 at 08:59, Jakob Erdmann <namdre.s...@gmail.com> wrote:
Hello,
The fastest and most efficient): call duarouter once will all the trip files. duaIterate does the same thing using subprocess.call but it does this seperately for each file. The only downside is that you have to use your own code the seperate the trips into separate files (if needed) since duarouter will create a single output file. Note, that net.getShortestPath only considers distances not speeds. This could lead to unexpected routes if there are some slow shortcuts in your network.
You can also build routes using traci.simulation.findRoute

regards,
Jakob



Am Mo., 8. März 2021 um 13:06 Uhr schrieb Chris Abraham <chrisb...@gmail.com <mailto:chrisb...@gmail.com>>:
After scouring the docs the whole day, the only solution I can think of is to use getShortestPath() from sumolib.net.Net <https://sumo.dlr.de/daily/pydoc/sumolib.net.html#Net>, and build arou.xmlfile from its outputs. Does that sound possible? I was hoping for an easier way. Also I wanted to double check that the function is maintained before I start coding.

Chris

On Mon, 8 Mar, 2021 at 07:37, Chris Abraham <chrisb...@gmail.com <mailto:chrisb...@gmail.com>> wrote:
Hello all,

I currently have around 2000 trip files, each describing the trip that a vehicle makes via a series of stops, as follows:

<trip id="Taxi1_Day1" type="eTaxi" depart="53564" from="173819953" to="802374502#1">
        <stop lane="173819953_0" until="53565"/>
        <stop lane="68612608#0_0" until="53650"/>
        ⋮
</trip>

Each trip file has around 750 stops. My aim is to generate a simulation corresponding to each trip file, which routes between the stops of that trip file. All the trip files correspond to the same network file, which is around 480 MB big. I want to do the route generation from Python preferably.

My current approach is to run duaIterate.main() (from$SUMO_TOOLS/assign) for each of the trips. However, this is taking very long. I think the problem is thatduaIterate.main() takes a lot of time to load the network each time. It also takes almost all of my RAM to load the network, so I can't run the process for multiple trip files concurrently. It would be great ifduaIterate.main() provided a way to pass in the network /object/ (i.e. sumolib.net.Net <http://sumolib.net.net/>), rather than the /path/ to the network file.

If I could do that, I think it would take much quicker, and I could run multiple duaIterate processes concurrently, without running out of ram. Do you know if it is possible, or if there is a better approach?

Regards,
Chris
_______________________________________________
 sumo-user mailing list
sumo-user@eclipse.org <mailto:sumo-user@eclipse.org>
To unsubscribe from this list, visit <https://www.eclipse.org/mailman/listinfo/sumo-user>

_______________________________________________
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to