[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sumo-user] Loading state and simulation start speed
|
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
Forking the simulation directly is not supported. You can only start new processes that load the same state.
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
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
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
Attachment:
libsumo_example.zip
Description: Zip archive
Attachment:
traci_example.zip
Description: Zip archive