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.55k stars 1.43k forks source link

Teleporting on restricted/forbidden lane confuses detectors #14168

Closed wangchao2022 closed 10 months ago

wangchao2022 commented 10 months ago

I have set the emergency lanes and set the closingLaneReroute's parameter allow=“vip”.Under normal circumstances,the nVehEntered of detector output data shuould be 0, but we get the non-zero number. Why does this happen and how should it be resolved?

If possible, upload an example that shows your problem. 微信图片_20231217163038 SUMO-version:1.16.0

operating system:

m-kro commented 10 months ago

Did you check in sumo-gui whether the lane had its permissions changed and whether there were no vehicles on it?

wangchao2022 commented 10 months ago

Did you check in sumo-gui whether the lane had its permissions changed and whether there were no vehicles on it?

For example,I set the emergency lane parameter allow=“vip”, the color will be gray and there will not appear vehicles theoretically. 微信图片_20231218175723

Only when the parameter allow=vip is not set the emergency lane will turn black and there will be vehicles passing by. 1 2

Since our simulation took a long time, we did not check each one one by one.

m-kro commented 10 months ago

It could be that some vehicles were still on the emergency lane when you closed it. Then they might have passed the detector while looking for a gap to change lanes. Now if you open/close lanes frequently and there are few gaps, this may be visible in the detector data as well.

wangchao2022 commented 10 months ago

It could be that some vehicles were still on the emergency lane when you closed it. Then they might have passed the detector while looking for a gap to change lanes. Now if you open/close lanes frequently and there are few gaps, this may be visible in the detector data as well.

Thank you for your answer,but this happened when the emergency lane closing all the time.

m-kro commented 10 months ago

Then please provide a minimum example scenario (attach it zipped to your post). I could not reproduce the problem using my own toy example. Do your closing times align at all with the detector aggregation interval?

wangchao2022 commented 10 months ago

our model example.zip Here is our model example. Our test result shows there have vehicles passing by from 38400s to 71700s in the emergency lance.

m-kro commented 10 months ago

Thanks for your example scenario. I could reproduce the problem. It seems vehicles from other lanes are detected by the detector on the rightmost lane which is very strange...?!

m-kro commented 10 months ago

Related to frequent teleports (time-to-teleport 1). There is some last resort logic which would teleport vehicles on the rightmost lane:

https://github.com/eclipse-sumo/sumo/blob/effa408d743e14cc3149c088ae7f46c914ec3512/src/microsim/MSVehicleTransfer.cpp#L194

@wangchao2022: While we try to understand how to prevent this, you could disable teleporting by time-to-teleport -1 and get rid of your detector problems.

wangchao2022 commented 10 months ago

In our simulation, if the time-to-teleport set bigger, maybe some other problems happen. And if the lane were not crowded like this, the detector would not record the strange data, so it seems like a bug happened in the crowded scenario?

m-kro commented 10 months ago

@wangchao2022 : I have changed the code such that vehicles are not teleported anymore on forbidden lanes as long as there are other options. You can build fresh binaries from Github source or wait for the new development binaries of tomorrow.