Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Subscriptions with libsumo

Hello,
removal of subscriptions in libsumo is only supported in a recent development version and it's not terribly intuitive right now:
https://github.com/eclipse/sumo/commit/488c33a54319b6ddb4eb45f1a18e1fb8aa7f38b4
However, I think you don't gain any speed from using normal subscriptions with libsumo.
Context subscriptions still have their use due to their filtering functionality.

regards,
Jakob





Am Di., 3. Dez. 2019 um 15:08 Uhr schrieb Tobias Jacobowitz <tobias.jacobowitz@xxxxxxxxx>:
Hello,

I was looking into using the subscription mechanism to speed up my Sumo
simulations, but I am running in some issues when using this mechanism
with libsumo.

First question: Does it actually make sense to use subscriptions in
combination with libsumo? For regular traci I can see quite a
significant speed up, but I wasn't sure if I will get something similar
when using libsumo?

I am using the subscription like this:

traci.vehicle.subscribe(vehicle_id, [traci.constants.VAR_LANEPOSITION])

I only execute this the first time a vehicle enters the simulation (so
not every simulation step) and it works fine with traci.

If I run the same code in libsumo, I will get an error message as soon
as the vehicle leaves the simulation:

libsumo.libsumo.TraCIException: Error: Vehicle '<vehicle_id>' is not known.

I tried to unsubscribe from vehicles before they leave the simulation,
but then noticed that this mechanism is apparently only implemented in
traci and not in libsumo. So now I am stuck as I will get an error in
libsumo when a vehicle leaves the simulation, but I can't unsubscribe at
the same time.

Any advice on how I can solve this issue or if I am misunderstanding
something?

Thank you very much for your help in advance.

Best regards,

Tobias Jacobowitz

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top