AndreaVidali/Deep-QLearning-Agent-for-Traffic-Signal-Control

a mistake in SimRunner.py

ynuwm opened this issue · 7 comments

ynuwm commented

I run this project, a error occurs in SimRunner.py:
wait_time_car = traci.vehicle.getAccumulatedWaitingTime(veh_id)
so, I revise this line to:
wait_time_car = traci.vehicle.getWaitingTime(veh_id)
is that right? Can you give me some suggestions?

I think it's right, because I look for it in official traci documentation and command. I think this is more in line with the actual situation. Right?

I think using getAccumulatedWaitingTime is correct.

If we use getWaitingTime here, then the agent may repeatedly turn on/off the signal to make cars move for a sec and reset wait_time_car to 0 (before crossing the intersection). This kind of strategy will be rewarded, but won't be helpful.

ynuwm commented

Thank you, but I found no getAccumulatedWaitingTime function interface in sumo 0.30.0
Should I change sumo version?

Yes, I think you should change the sumo version since it's recommended to download from the link above at README.

ynuwm commented

Thank you, I will try this version.

ynuwm commented

I change my sumo version, the program runs normally.

I found something interesting, when I use getWaitingTime the results curve of queue and delay are exactly the same. This is definitely not right. So your advice is right, we should use getAccumulatedWaitingTime. Thank you.

Thanks for letting us know about your experiment, @ynuwm !