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.36k stars 1.37k forks source link

TraCI induction loop considers vehicles of the current time step #3552

Open behrisch opened 6 years ago

behrisch commented 6 years ago

it should only consider values of the last time step as stated in documentation and function names

aminissn commented 6 years ago

Hi Michael, do you have any idea when this issue will be solved? I guess it is still unsolved for version 32!

Thanks! Sasan

behrisch commented 6 years ago

No sorry, but I put it on my list.

aminissn commented 4 years ago

Is there a workaround for this bug? One other thing that can be nice to have is to get occupancy=100% when a non-moving vehicle stands on the detector. Currently, I get -1. I guess it gives values when getTimeSinceDetection is 0, which is not the case when there is congestion on the detector.

behrisch commented 4 years ago

@aminissn Could you test this or even better send a small test scenario?

aminissn commented 4 years ago

@behrisch Here is the example I was testing with. I am basically comparing the FD from TraCI and loop detector output file. 01_onelane.zip

m-kro commented 4 years ago

@behrisch: Due to your changes at https://github.com/eclipse/sumo/blob/c31e7cbd20acffe7a4b9a0e5365190993351b2b3/src/microsim/output/MSInductLoop.cpp#L295, standing vehicles are only considered in one time step for e.g. TraCI inductionloop.getLastStepVehicleNumber. Only when it just has entered the detector, its enter time fulfills the condition. Is that really the desired behaviour?

I would just erase the condition to have all vehicles on the detector contributing to the result....?!

behrisch commented 4 years ago

@m-kro No, it is not. It is very high on my ToDo-List for the new year to solve this ticket. My general approach would be to let the behavior mimic a real loop as close as possible, meaning all values which require that the vehicle has already left the loop (speed, length, ...) are only available when the vehicle has left. Everything else should move to the instant loop. @aminissn Do you agree here?

aminissn commented 4 years ago

@behrisch I agree on making the values available after the vehicle has left the detector.

aminissn commented 2 years ago

I totally forgot about this matter and was trying to implement an ALINEA controller and noticed the difference between the Fundamental Diagram obtained from TraCI and the generated E1 detector output. Just curios about the best way to get the "right" occupancy and flow measurements using TraCI for actuated control applications? image