{"id":24071112,"url":"https://github.com/shanto268/comprehensive_simulation_traffic_analysis_software","last_synced_at":"2025-07-19T02:31:55.596Z","repository":{"id":71910945,"uuid":"257077402","full_name":"shanto268/comprehensive_simulation_traffic_analysis_software","owner":"shanto268","description":"This repository contains software for multi-agent simulation model of mixed traﬃc ﬂow of connected (HVs) and automated vehicles (AVs) in Python using pygame, matplotlib, numpy, scipy and seaborn libraries. The software is capable of simulating many different cases of traffic flow and creates data files and figures for the purpose of analysis. ","archived":false,"fork":false,"pushed_at":"2020-06-22T18:46:21.000Z","size":21788,"stargazers_count":25,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T13:06:37.960Z","etag":null,"topics":["analysis","autonomous-vehicles","ca","cellular-automata","heterogeneous","mixed-traffic-flow","nashc","simulation","traffic","traffic-analysis","traffic-flow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shanto268.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-19T18:50:46.000Z","updated_at":"2025-02-25T08:35:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ce31bf1-c217-4e80-8b32-4008c805af79","html_url":"https://github.com/shanto268/comprehensive_simulation_traffic_analysis_software","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shanto268/comprehensive_simulation_traffic_analysis_software","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanto268%2Fcomprehensive_simulation_traffic_analysis_software","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanto268%2Fcomprehensive_simulation_traffic_analysis_software/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanto268%2Fcomprehensive_simulation_traffic_analysis_software/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanto268%2Fcomprehensive_simulation_traffic_analysis_software/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shanto268","download_url":"https://codeload.github.com/shanto268/comprehensive_simulation_traffic_analysis_software/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanto268%2Fcomprehensive_simulation_traffic_analysis_software/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265876894,"owners_count":23842956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","autonomous-vehicles","ca","cellular-automata","heterogeneous","mixed-traffic-flow","nashc","simulation","traffic","traffic-analysis","traffic-flow"],"created_at":"2025-01-09T16:38:36.081Z","updated_at":"2025-07-19T02:31:55.572Z","avatar_url":"https://github.com/shanto268.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NaSch_CA_Traffic_Flow_Analysis_Software\n\nThis repository contains software for multi-agent simulation model of mixed traﬃc ﬂow of connected (HVs) and automated vehicles\n(AVs) in python using pygame, matplotlib, numpy, scipy and seaborn libraries. The software is capable of simulating many\ndifferent cases of traffic flow and creates data files and figures for the purpose of analysis. Currently I am working on\nmaking the front end of the software more user friendly for potential commercialization.\n\n## CA Traffic Analysis Software\n\nA pygame, numpy and matplotlib based software that lets you create simulation of different traffic flow scenarios using\nthe concepts of Cellular Automata and perform data analysis and visualization.\n\n### purpose of software:\n\nThis software was designed under the supervision of Dr. Jia Li using inspiration from Nagel-Schrekenberg's Cellular Automata Rules for Traffic flow. The software can be used to simulate traffic for many different types of car and traffic situations and record all the important traffic-flow parameters and allows the user to track customized parameters as well. The software also comes with a data analysis and visualization package that helps the user make sense of the data.\n\n### Current Version: 0.2\n\n#### Customization Abilities\n\nThe current version of the software deals with simulating heterogeneous traffic flow of Autonomous Vehicles (AVs) and Human-driven Vehicles (HVs) on a three lane circular road. The software has three different models of AVs that is being used in two experiments in a research project led by Dr Li. Through changes in the car.py and road.py files, multiple new models of AVs can be introduced and tested. The software allows simulation traffic with both constant density and increasing density (to generate Fundamental Diagram) the density settings can be changed in simulationManager.py file. \n\n#### New Version: 0.3 (Work In progress)\nThe next version will have a GUI enabled customization screen before each simulation and direct analysis features within the same framework.\n\n![GUI1](https://github.com/shanto268/comprehensive_simulation_traffic_analysis_software/blob/master/GUI.png)\n\n![GUI2](https://github.com/shanto268/comprehensive_simulation_traffic_analysis_software/blob/master/GUI2.png)\n\n![GUI3](https://github.com/shanto268/comprehensive_simulation_traffic_analysis_software/blob/master/GUI3.png)\n\n![GUI4](https://github.com/shanto268/comprehensive_simulation_traffic_analysis_software/blob/master/GUI4.png)\n\n![GUI5](https://github.com/shanto268/comprehensive_simulation_traffic_analysis_software/blob/master/GUI4.png)\n\n![GUI6](https://github.com/shanto268/comprehensive_simulation_traffic_analysis_software/blob/master/gui3.png)\n\n### NEW VERSION: 1.0\nA version of a reinforced learning algorithm applied to train the av is currently in the works in one of private repository, I plan on making that public as soon as I am done writing a paper using that version. I wanted to include this news in this readme just to inform y'all that reinforced learning regimes can be easily applied on to this framework.\n\n## SUMMARY OF FILES AND DIRECTORIES\nThe following outlines all the relevant directories and files for the software.\n\n**base directory:** this is the folder where all the directories are found.\n- nagel.py\n This code is the initiator of the entire software. It starts the simulation engine running on pygame and returns control to the rest of the program files.\n- representation.py\nThis code is responsible for the visualization of the road, car, and information in the pygame window.\n- infodisplayer.py\nThis code takes data from the back end of the software and displays that information on the pygame window by sending that data to the representation.py file. It also records all the parameters of interest in the text files.\n- plot_exp1.py\nThis code produces all the plots needed for experiment 1 from the raw data text file.\n- plot_exp2.py\nThis code produces all the plots needed for experiment 2 from the raw data text file.\n- combined_plot_exp1.py\nThis code makes plot that needs input from experiment 1 test cases using the raw text data files.\n- simulationmanager.py\nThis code is responsible for updating the traffic flow simulations. It constantly transfers control back and forth from the car.py, road.py, representation.py and infodisplayer.py file.\n\n**\"Config\" directory:** this directory holds files in charge of road/traffic situations.\n- case.py\nThis file describes the dimensions of the pygame window and the type of road/traffic condition to be simulated.\n\n**simulation directory:** this directory holds files that describe oop code files.\n- car.py\nThis code creates an object called car with certain properties and functions that describes the vehicles behavior.\n- road.py\nThis code creates an object called car with certain properties and functions that describes the vehicles behavior.\n- speedlimits.py\nThis code creates a provision to make traffic lights or damaged road conditions.\n- trafficgenerators.py\nThis code decides how traffic is generated in the simulation.\n\n**\"DRAFT_2\" DIRECTORY:** It contains all the raw data and results from the simulation experiments.\n\n## INSTALLATION\nInstall the following libraries in python.\n```BASH\npip install numpy \npip install matplotlib \npip install pygame\n```\n\n## USAGE\nTo run the simulation in batch mode execute the following command in the base directory.\n```python\npython3 gameEngine.py batch\n```\n\nTo run the simulation in gui mode, execute the following command in the base directory.\n```python\npython3 gameEngine.py gui\n```\n\nUse the plot python files and change the directory sturcture for the input files to look at the analysis report of the simulation.\n\n**the next version would resolve this nasty directory change issue. Sorry about this for the time being.**\n\nExample analysis figures:\n![FD](https://github.com/shanto268/comprehensive_simulation_traffic_analysis_software/blob/master/flux_analysis.png)\n\n# To Do:\n- [ ] Need to fix the SimpleTrafficGenerator method\n- [ ] Need to implement mode for highway sim and not only circular road\n- [ ] GUI interface creation\n- [ ] FD Creation Mode\n- [ ] Full Customization through GUI integration\n- [ ] Circular Road Representation\n- [ ] Website creation with front end and back end of this software\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanto268%2Fcomprehensive_simulation_traffic_analysis_software","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshanto268%2Fcomprehensive_simulation_traffic_analysis_software","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanto268%2Fcomprehensive_simulation_traffic_analysis_software/lists"}