Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Timing difference between TraCI and LibSUMO subscriptions data

Hello,

My version info:
TraCI VERSION 21
'SUMO 79d8ebc13'
Ubuntu 18.04.6 LTS

A subscribe() call in TraCI seems to take effect immediately, while a subscribe() call in LibSUMO seems to only take effect after a traci.simulationStep() has taken place.

What I mean is that a variable where I store all the subscription results using getAllSubscriptionResults() automatically gets updated the instant I subscribe a new vehicle to some information in TraCI, but that same variable takes another traci.simulationStep() to be updated in LibSUMO.

I have created a working example to produce the behavior attached as a zip with this. All that needs to be done is comment in/out the import so that it picks either traci or libsumo. The relevant code that shows this is in the MyEnv.step() function.

Please advise if what I inferred from the behavior is correct, and if there is any way to get around it. (Make them compatible with both TraCI/LibSUMO?)

Thank you.

Sincerely,
Hriday

Attachment: traci_libsumo_subs_diff.zip
Description: Zip archive


Back to the top