Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Identical env states

Thanks again Jakob for the answers
1) Ok. Eventually I just had a precision issue. I solved it by setting save-state.precision to the integer number of digits I need.

Stefano

On Tue, Mar 14, 2023 at 2:45 AM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
1) the state holds the position at the beginning of a time step whereas all other outputs hold the position at the end of a time step (so including vehicle movements for that step).
2) loading state clears all subscriptions so you need to renew them afterwards (since the state could hold anything or nothing subscriptions are at risk of becoming invalid anyway)
3). Thanks, it's 'traci.load' and the documentation has been fixed.

Am Mo., 13. März 2023 um 17:12 Uhr schrieb Stefano Bonasera <stefano.bonasera@xxxxxxxxx>:
Hi Jakob,

Thanks for the prompt response, it was really helpful.
I find two issues with the save/load approach, plus another issue with the documentation that I hope you can help me with:
1) referring again to the previous env1 and env2 example: when env2 loads the state saved from env1, vehicle information is a bit off. For example, when getting position information from one of the vehicles, the state prior to been saved reports a position of (101.5000452506627, 95.2), but if I verify the position after having loaded that specific state file I get a position of (101.49894165466144, 95.2) for the same vehicle - similarly happens for other quantities. Do you have any hints on the reason of this error?
2) After env2 loads the state, I try to step within the simulation of env2. However, after the simulation step, the _subscriptionMapping gets empty at field 235, since the read int of the result (after sending the cmd of CMD_SIMSTEP) is always 0. Do you know what is it causing this problem?
3 - documentation) It seems the docu page of save and load (https://sumo.dlr.de/docs/Simulation/SaveAndLoad.html) reports two load options, but there is no def load under tools/traci/_simulation.py 

Thank you,
Stefano

On Fri, Mar 10, 2023 at 10:04 AM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:

Am Do., 9. März 2023 um 17:14 Uhr schrieb Stefano Bonasera <stefano.bonasera@xxxxxxxxx>:
Hello,

SUMO version: 1.16

I am struggling with the following issue, working on python:
I start with two base environments (env1 and env2), randomly initialized, leveraging flow to spawn actors, and with identical road networks. The two envs will have at some point two different configurations of existing actors/env_states - e.g., env1 has 4 actors with specific x_i, y_i locations, velocity (lon and lat), angles, controllers, while env2 has 2 actors with different features.
 
At some point in my algo, I want env2 configuration to be identical to env1's one via copying the current configuration/env_state of env1 into env2: following the previous example, the final result would be for env2 to have a configuration with 4 actors, each with features (x_i, y_i locations, velocity (lon and lat), angles, controllers, ...) identical to what env1 has at that time.

I have tried several approaches to manually removing/adding and moving actors - all unsuccessful since I can change only a limited amount of features of each actor (for example I cannot set the controllers, or the lateral velocity), resulting in two different envs. Are you aware of any solution for replicating env1 configuration/env_state into env2? 

Thank you so much for taking the time to read my email and for the help in advance.

--
Kind regards,
Stefano.
_______________________________________________
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


--
Kind regards,
Stefano.
_______________________________________________
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


--
Kind regards,
Stefano.

Back to the top