Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Typing with Pylance with parallelized simulations

Hello,

I run multiple parallelized sumo simulations using traci. This works out quite fine.

To mitigate the need to use always the traci switch command, I store for each simulation a traci.Connection object using traci_object: traci.Connection = traci.getConnection(id). This works fine.

But my issue with that way is, that in VS Code where I write my python code to interface SUMO using traci gives nice code completion when I use traci.vehicle.getSpeed(id) but not with traci_object.vehicle.getSpeed(id). There it does not offer vehicle.getSpeed(id) and marks it as "Cannot access member vehicle for type Connection". What would be the right way to write the code?

Thanks a lot,

Kind regards,

Patrick



Back to the top