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

A framework where a deep Q-Learning Reinforcement Learning agent tries to choose the correct traffic light phase at an intersection to maximize traffic efficiency.
MIT License
405 stars 146 forks source link

a mistake in SimRunner.py #3

Closed ynuwm closed 5 years ago

ynuwm commented 5 years ago

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?

seungwonpark commented 5 years ago

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 5 years ago

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

seungwonpark commented 5 years ago

You can download sumo 1.2.0 at https://www.dlr.de/ts/en/desktopdefault.aspx/tabid-9883/16931_read-41000/

seungwonpark commented 5 years ago

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

ynuwm commented 5 years ago

Thank you, I will try this version.

ynuwm commented 5 years ago

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.

seungwonpark commented 5 years ago

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