Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Loading state and simulation start speed

Currently, libsumo only supports a single simulation per runtime environment. If you need multiple instances at the same time, they must be isolated processes.

Am So., 30. Mai 2021 um 22:26 Uhr schrieb Marcelo Andrade Rodrigues D Almeida <md@xxxxxxxxx>:
Hi Jakob.

Libsumo seems promising for my use case.

However, I'm running into problems when starting multiple simulations.

The labels and connections are gone, so I manage the connection directly by 'traci.command'. Does that mean that I can only have one simulation at a time?
I tried to put one simulation per process, but it just hangs when it tries to start a simulation inside another process, but regular traci works fine (see attached examples).

Thank you in advance

Sincerely,

Marcelo d'Almeida


On Fri, May 28, 2021 at 4:42 AM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
Forking the simulation directly is not supported. You can only start new processes that load the same state.
To avoid tcp overhead you can use libsumo: https://sumo.dlr.de/docs/Libsumo.html

Am Do., 27. Mai 2021 um 15:27 Uhr schrieb Marcelo Andrade Rodrigues D Almeida <md@xxxxxxxxx>:
Hi Jakob

Thank you for the information


One question though: Is there any way of forking the simulation itself?

I know Traci uses a TCP socket connection, so it would be necessary to duplicate the server-side data so a dedicated connection can be established.

This would avoid the time to save/load the state and the time to redo all the subscription

Thank you in advance


On Tue, May 25, 2021 at 5:28 AM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
You can speed up your runs by calling simulation.loadState instead of simulation.load

Am Sa., 22. Mai 2021 um 17:15 Uhr schrieb Marcelo Andrade Rodrigues D Almeida <md@xxxxxxxxx>:
Perhaps the actual problem is that the first connection tries always fails (connection refused). As consequence, I need to wait 1 second every time I try to start a simulation.

I'm going to start using the "connect" function myself to reduce the waitBetweenRetries


Sincerely,

Marcelo d'Almeida

On Fri, May 21, 2021 at 4:10 PM Marcelo Andrade Rodrigues D Almeida <md@xxxxxxxxx> wrote:
Hi Proyash

Thank you for dedicating time to answer!


In my experiment, I need to execute different possibilities of traffic light configurations. 

So in practice, the things I need to do are basically re-running the simulation steps several times before modifying the original one. That's the reason I resort to saving and loading the simulation state.


Sincerely,

Marcelo d'Almeida


On Fri, May 21, 2021 at 3:55 PM Proyash Podder <ppodd002@xxxxxxx> wrote:
Hello Marcelo!
Reading your statement, what thing first came into my mind is using TraCI.
TraCI (https://sumo.dlr.de/docs/TraCI.html) provides you opportunity to halt simulation at each step (e.g., 1 second ) and do whatever thing you need to do and again, run the simulation from that halting point.

You can read the documentation of TraCI and see if it fits for your work.

-
Proyash

> On May 21, 2021, at 2:50 PM, Marcelo Andrade Rodrigues D Almeida <md@xxxxxxxxx> wrote:
>
> Hi everyone
>
> In my experiments, I need to save and load the simulation several times, and each time I do a loading, I start a new simulation.
>
> Generally speaking, starting a simulation does not take too long (e.g., 1 second)
>
> However, since I have to do it several times, most of the experiment time is about starting those. (I save the state in a time step and test it several possibilities from it)
>
>
> 1.: Do I really need to start a new simulation to load a state? It does not sound like just loading a state should take so much time.
>
> 2.: if (1) is not viable, how can I just... like... fork a simulation so I could just copy data over (i.e., "duplicate a simulation") and start using it with no delay? 
>
>
> Sincerely,
>
> Marcelo d'Almeida
> _______________________________________________
> 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
_______________________________________________
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