Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Generating routes from many trip files

You could use the previously mentioned id of spacing out their departures over time and then adapt the until times with the same offset.
An alternative would be to define the stops with only a short 'duration' instead of 'until'. Then compute the traveltime that would have result from 'until' based on tripinfo-output and stop-output.


Am Do., 18. März 2021 um 12:34 Uhr schrieb Chris Abraham <chrisbrhm@xxxxxxxxx>:
Hi Jakob. Sorry for resurrecting this thread.

I had implemented as you suggested, and I thought it worked, but today I noticed an error in the simulation results.

All my routes had `stop`s which were defined with the `until` attribute. This meant that, after the first vehicle had simulated, all the other vehicles did not make any stops, since the time of the timesteps did not reset after the first vehicle was finished.

I gave it some thought, but I can't figure out a way to simulate all the 2000 routes with their stops, without reloading the network each time...

Regards,
Chris Abraham


On Tue, Mar 9, 2021 at 2:02 PM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
Again, the easiest solution is to put them in the same route file. To avoid interactions between the vehicles either space out their depart times by a few hours (depending on  network size and maximum travel time) or set option --max-num-vehicles 1 (this will make the next vehicle start once the predecessor has arrived).

Am Di., 9. März 2021 um 12:43 Uhr schrieb Chris Abraham <chrisbrhm@xxxxxxxxx>:
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.sumo@xxxxxxxxx> 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 <chrisbrhm@xxxxxxxxx>:
After scouring the docs the whole day, the only solution I can think of is to use getShortestPath() from  sumolib.net.Net, and build a rou.xml file 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 <chrisbrhm@xxxxxxxxx> 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 that duaIterate.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 if duaIterate.main() provided a way to pass in the network object (i.e. 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@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top