eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.51k stars 1.42k forks source link

closing a lane with traci does not update the choice of best lanes #14225

Open ZhenYu112 opened 8 months ago

ZhenYu112 commented 8 months ago

Add your issue description here. I attempted to use Traci in the simulation to change the lane state and achieve a variable lane. I would prohibit vehicles from driving on that lane, but found that the vehicle would stop before the connection and would not automatically search for another available connection and lane; If possible, upload an example that shows your problem. 企业微信截图_17052887283192 When I use the "close lane" function again in sumo gui for lanes that have been banned in traci, the vehicle will not stop before the connection and will automatically search for available connections and lanes to reach the destination; sumo1

I want to know how to use Traci to achieve an effect similar to that in sumo gui: after closing the lane, other vehicles on the lane can leave normally, and subsequent vehicles no longer enter the lane, but can automatically find available connections and lanes to reach th e destination. 企业微信截图_1705297544579 this is i used traci api If you have time, could you please answer me? Thank you very much! SUMO-version: 1.19.0 operating system: windows 10

behrisch commented 8 months ago

I can confirm the behavior and think this is some kind of performance optimization. You can always call traci.vehicle.updateBestLanes for all vehicles on the affected lane to work around this. But we should really check whether we could do this immediately (at least optionally). I would not expect large runtime effects.

ZhenYu112 commented 8 months ago

I will try this method, thank you very much!

I can confirm the behavior and think this is some kind of performance optimization. You can always call traci.vehicle.updateBestLanes for all vehicles on the affected lane to work around this. But we should really check whether we could do this immediately (at least optionally). I would not expect large runtime effects.