alok20121998 / Traffic_Signal_Optimization

Traffic Signal Timings Optimization Based on Genetic Algorithm and Gradient Descent
5 stars 2 forks source link

Help ! don't understand how to run it(T.T) #2

Open phm1234567 opened 4 years ago

phm1234567 commented 4 years ago

Sorry to trouble you again . I'm a beginner,With these xml files , now I can run the randomTrip.py and read these code,but I still don't know how to run the entire project。 Is that a finished project ?
Can you add a documentation to show how to use it ? Thanks !

alok20121998 commented 4 years ago

The dependencies are a bit of a mess, I'll clean things up and create a readme file on how to run the project as soon as i can.

phm1234567 commented 4 years ago

OK! Thank you very much!

alok20121998 commented 4 years ago

Still a lot of refactoring needed, but I've removed a few unnecessary dependencies and added a readme. Let me know if you need any help.

phm1234567 commented 4 years ago

Thank you very much, your project is great, but I still have some questions need your help.

  1. With run GD.py,The output is as follows : Is this output correct? What does each parameter mean? How does the output reflect the optimized semaphore? Shouldn't there be an optimized signal timing and other output? [ (4 statements of output) Retrying in 1 seconds Warning: Deprecated vehicle classes 'rail_fast' in input network. Retrying in 1 seconds100.00*RT, ~55700.00UPS, TraCI: 41ms, vehicles TOT 679 ACT 557 BUF 1 Step #241.00Warning: Vehicle '474' performs emergency braking with decel=-9.00 wished=4.50 severity=1.00, time=241.00. ]
  2. Do I need to run GA-GD/GA.py again for each optimization? Do GA_GD, GA.py have the same running effect, why are there two in a project, is it just for comparison? Can I save the optimized signal timing scheme?
  3. If my requirement is to input map files, and output the optimized signal timing scheme, and I hope to see the improvement of the optimized effect, can this project be satisfied?
  4. How are the adaptive function (objective function) and some parameter values set in your project? Are there any articles about these theories to learn?
  5. The external input required for the project is only map.osm.xml, right? There are a lot of questions, sorry to trouble you and look forward to your answer(😊)
phm1234567 commented 4 years ago

Sorry, Was I asking too many questions? I'm sorry if it bothers you

alok20121998 commented 4 years ago

No, not at all. Just a lot of work right now. 1) No, that isn't the right output. I'll look into it 2) Yes, each time you run GA/GA_GD, you run a new optimization. Kinda, they are different algorithms to create an optimized set of timings for the traffic signals. Yes you can, I'll make it so that the timing is returned rather than just printed 3) It can be done, You will have to write a script that will take the map file, then run run.sh to create the routes and everything, then run GA/GA_GD. That will output the timings. Then your script should call simulator.py with the provided timings (simulator.py can be made to run the simulations graphically, not sure if it does that yet) that can be compared with other signal settings run by simulator.py 4) The objective function is the total waiting time of the cars that can be calculated by using traci. Other parameter values such as mutation rate, population size, number of generations are based on lots of previous runs 5) Currently, the input is the map file and the routes files

alok20121998 commented 4 years ago

I think I can help with the script in 3, maybe next week

phm1234567 commented 4 years ago

You are so nice,Thank you very much!

phm1234567 commented 3 years ago

Hello, I'm sorry to bother you again. I was working on other projects a few months ago, and now I have to continue working on this. My appeal is this: Input: map route and other information, Output: The result of the optimized signal lamp and as much relevant information as possible during the simulation (preferably a chart), as well as a clear comparison before and after optimization. I'm sorry to always trouble you. It's very important to me. I am a student and want to learn your excellent code reuse as homework. I can pay some fees if needed. Thank you so much!

alok20121998 commented 3 years ago

There is no need for a fees, don't worry about it. I'm not sure I understand what you want for the input, do you mean you would like a file containing the information. If so, that information can be found in the xml files. Regarding the output, I think I can help with the visualization. The before and after comparison can be performed visually and in terms of the computed metric (total waiting time). The optimization outputs a set of timings as well as the total waiting time. I wrote a script a while back that could visualize the simulation based on provided signal timings from the optimization. That visualization could then be compared with the visualization for the set of default timings. I will have to look around for that script, as I don't think I committed it to this repository. I will probably have to make it again as I switched laptops

phm1234567 commented 3 years ago

You are so nice,Thank you for your enthusiasm. I carefully read your code and summarized it, but there are still some processes and parameter methods were not understand.This picture is my understanding,I think it was wrong.

  1. Can you draw an overall process call diagram (including sumo)
  2. Output: a variety of parameters that can be seen by the sumo simulation to Excel or other (average time, queue length, etc., the more the better) and visualize as much as possible. 3.I hope you can explain how GA and GD are combined (or through 1), and the main parameters and Objective function used by the two algorithms. 【Because when I showing homework, I need to tell the corresponding algorithm flow and main methods, as well as the choice of parameters and the final optimization results】
庞卉淼

hmpang1995@163.com | 签名由网易邮箱大师定制

On 09/8/2020 23:12,alok20121998notifications@github.com wrote:

There is no need for a fees, don't worry about it. I'm not sure I understand what you want for the input, do you mean you would like a file containing the information. If so, that information can be found in the xml files. Regarding the output, I think I can help with the visualization. The before and after comparison can be performed visually and in terms of the computed metric (total waiting time). The optimization outputs a set of timings as well as the total waiting time. I wrote a script a while back that could visualize the simulation based on provided signal timings from the optimization. That visualization could then be compared with the visualization for the set of default timings. I will have to look around for that script, as I don't think I committed it to this repository. I will probably have to make it again as I switched laptops

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

alok20121998 commented 3 years ago

Here is the diagram link: https://drive.google.com/file/d/1oPN_HLD3xh8HITkiDb2hfbE2iZzA-DkQ/view?usp=sharing

Also, I have attached a copy of the paper I wrote, I think it will do a much better job of explaining the algorithms used than the diagram. Note: I say gradient descent, but is should be heuristic search, as the algorithm that I use isn't gradient descent but based off of it Alok_TrafficSignalOptimization.pdf

I added the script to visualize the result using SUMO, I can't push the code right now, you can download the simplified project from here: https://drive.google.com/file/d/1XNfrbSt9vFnHFUSOoMyC9w9RK7PDW5Ei/view?usp=sharing

phm1234567 commented 3 years ago

Thank you, it helped me a lot. I have an idea here: If we can add the influence of the number of lanes in the road network on this basis, and allow the number of lanes to change, the specific treatment of tidal traffic flow may be an innovative point. After optimization, the optimal lane combination method andSignal timing scheme.I have some summaries on the lanes. If necessary, I can sort them out and send them to you.

庞卉淼

hmpang1995@163.com | 签名由网易邮箱大师定制

On 09/9/2020 15:47,alok20121998notifications@github.com wrote:

Here is the diagram link: https://drive.google.com/file/d/1oPN_HLD3xh8HITkiDb2hfbE2iZzA-DkQ/view?usp=sharing

Also, I have attached a copy of the paper I wrote, I think it will do a much better job of explaining the algorithms used than the diagram. Note: I say gradient descent, but is should be heuristic search, as the algorithm that I use isn't gradient descent but based off of it Alok_TrafficSignalOptimization.pdf

I added the script to visualize the result using SUMO, I can't push the code right now, you can download the simplified project from here: https://drive.google.com/file/d/1XNfrbSt9vFnHFUSOoMyC9w9RK7PDW5Ei/view?usp=sharing

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

alok20121998 commented 3 years ago

I think that could be done with SUMO. However, is that applicable to real life? It is very difficult to change the number of lanes in a city.