-
Notifications
You must be signed in to change notification settings - Fork 1
/
readme_program_overview.txt
executable file
·122 lines (66 loc) · 5.92 KB
/
readme_program_overview.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
==========================================================================================================================
CA Traffic Analysis Software
A pygame, numpy and matplotlib based software that lets you create simulation of different traffic flow scenarios using
the concepts of Cellular Automata and perform data analysis and visualization.
Made by Sadman Ahmed Shanto in 2019
==========================================================================================================================
*** Purpose of software: ***
This 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.
*** Current version: 0.1 ***
The 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. The first experiment deals with analyzing the traffic flow of this heterogenous mix at three fixed densities: low, critical and high for the three different cases of AV models. The second experiment involves increasing the system density every N time steps till jam density is established and analyzing the fundamental diagram for the three different models. For the purpose of the research, the software looked heavily into self-organized clustering and lane formation phenomenon.
---------------------------------------------------------------------------------------------------------------------------
*** Summary of files and directories ***
The following outlines all the relevant directories and files for the software.
$$Base directory: This is the folder where all the directories are found.
>>> nagel.py
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.
>>> representation.py
This code is responsible for the visualization of the road, car, and information in the pygame window.
>>> infoDisplayer.py
This 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.
>>> plot_exp1.py
This code produces all the plots needed for experiment 1 from the raw data text file.
>>> plot_exp2.py
This code produces all the plots needed for experiment 2 from the raw data text file.
>>> combined_plot_exp1.py
This code makes plot that needs input from experiment 1 test cases using the raw text data files.
>>> simulationManager.py
This 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.
$$"config" directory: This directory holds files in charge of road/traffic situations.
>>> case.py
This file describes the dimensions of the pygame window and the type of road/traffic condition to be simulated.
$$"Simulation" directory: This directory holds files that describe OOP code files.
>>> car.py
This code creates an object called car with certain properties and functions that describes the vehicles behavior.
>>> road.py
This code creates an object called road with certain properties and functions that describes the rules that vehicles interacting with the
road should abide by.
>>> speedLimits.py
This code creates a provision to make traffic lights or damaged road conditions.
>>> trafficGenerators.py
This code decides how traffic is generated in the simulation.
"draft_2" directory:
>>> contains all the raw data and results from the simulation experiments.
---------------------------------------------------------------------------------------------------------------------------
*** Control Flow of program: ***
.-> car.py <----> road.py <-. <--------.
| | |
.->[simulation object files(back end)]--> trafficGenerator.py .----------------------------> combined_plot_exp1.py
| ^ ^ /
case.py --> nagel.py | |----------> data.txt----------------------------> plot_exp1.py
| | | \
.->[visualization files(front end)] v | .----------------------------> plot_exp2.py
| \ |------------------|
| | simulationManager.py
| | ^
v v |
infoDisplayer.py <------> representation.py /
*** How to run program (simulation): ***
To run the simulation, be in the base directory and then in a python/linux/terminal shell use the following command:
$ python nagel.py config.case
*** How to run program (data visualization): ***
To visualize data, you need to use one of .py files from the base directory which has the word "plot" in it. Make sure the the python file takes in the correct text data file as input from the right directory. To execute such a program use the following command:
$ python whatever_the_name_of_plot_file_you_want_to_use_is.py
---------------------------------------------------------------------------------------------------------------------------
*** Next version: 1.1 ***
The next version of the software would include a shell based front end that would take user inputs to make the process of simulation and data visualization more streamlined and easy to use.