Skip to main content

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

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

Attachment: pEpkey.asc
Description: application/pgp-keys


Back to the top