代写COMP702 Motorway Traffic Simulator with Autonomous Cars 2024/25代写Python语言
- 首页 >> C/C++编程Motorway Traffic Simulator with
Autonomous Cars
Design and Specification Proposal
COMP702 – M.Sc. project (2024/25)
1 Statement of ethical compliance: A0
Data Category: A
Participant Category: 0
I confirm that I have read the ethical guidelines and will follow them during this project. No data sources and human participants will be used in this project.
2 Project description
This project involves developing a microscopic traffic simulation using Python and Pygame to analyse and compare the behavioural differences between human drivers and autonomous vehicles (AVs) on motorways, evaluating their impact on traffic flow and road capacity under mixed traffic scenarios. The simulation will be implemented using Python for behavioural algorithms and Pygame for real-time visualization, incorporating distinct models for each vehicle type with different reaction times (0.3-0.5s for AVs vs 1-1.5s for humans), following distances, and lane-changing decision-making processes, testing multiple scenarios with varying AV penetration rates (0% to 100%) under different traffic density conditions. The simulation will display a visual motorway where colored vehicles represent human-driven and autonomous cars moving in real-time. Users can adjust settings and view live data showing traffic speeds, flow rates, and safety metrics, with charts comparing how different ratios of autonomous vehicles impact overall traffic performance.
3 Aim and Requirements
3.1 The main aim
The main goal ofthis project is to develop a microscopic traffic simulation system that accurately models and compares the behavioural differences between human drivers and autonomous vehicles (AVs) on motorways. The simulation will analyse how the penetration rates of autonomous vehicles impact traffic flow efficiency, safety metrics, and road capacity under traffic conditions.
3.2 Requirements
The requirements are:
- The simulation must model distinct behavioural characteristics for human drivers and autonomous vehicles, including reaction times, following distances, and lane-changing decision-making processes.
- The simulation must simulate multiple traffic scenarios with varying AV penetration rates from 0% to 100%, inflow and outflow traffic, different types of vehicles (normal cars, emergency vehicles, heavy load vehicles, aggressive and conservative drivers).
- The program must collect and display traffic metrics including average speeds, flow rates, and following distance measurements
- The user interface must allow adjustment of simulation parameters such as traffic density, AV percentage, types of vehicles, and vehicle behaviours.
- The simulation must export data for analysis and generate comparative charts to present performance differences between scenarios.
If time permits, we will also implement some desirable features such as:
- Environmental impact indicators showing fuel consumption and emission comparisons between human and AV scenarios
- Advanced statistical analysis tools with trend visualization for comparing different traffic compositions.
4 Key literature and background reading
Understanding behavioral differences between human drivers and fully autonomous vehicles (AVs) is crucial for accurate traffic simulation and predicting mixed traffic performance on motorways. These differences affect several driving behaviors that impact traffic flow, safety, and road capacity.
4.1 Reaction Time
Reaction time plays a vital role in maintaining smooth traffic flow. Studies found that shorter reaction time enhances traffic safety, efficiency and stability. AVs react to accidents in a time between 0.3 and 0.5 seconds, while human drivers takes about 1 to 1.5 seconds to react on the normal traffic conditions on motorways (Rydzewski and Czarnul, 2021). This faster response capability enables FAVs to handle traffic disturbances more effectively, maintaining traffic stability and preventing collusions that commonly occurs when human drivers react too slowly to sudden changes (Calvert et al., 2017). The superior FAV reaction time results from the vehicle-to-vehicle (V2V) technology in-built in the AV system, where it allows AVs to communicate and obtain quicker and precise response. In contrast, human reaction time vary significantly due to individual factors (age and experience), common distractions (use of mobile phones and talking to passengers, etc.), and physical impairments (fatigue, intoxicated, illness), which increase reaction time and risk of collusions (Poliak et al., 2022).
4.2 Headways
Headway refers to the following distance or time gap between consecutive moving vehicles, which also serves as a critical safety parameter and capacity determinant in traffic flow (Biswas et al., 2021). Insufficient following distances commonly lead to collisions when drivers cannot react and brake adequately during emergency situations. Despite traffic safety guidelines recommending a 3-second headway for human drivers, actual following behavior. varies considerably due to several behavioural traits like aggressive driving style. affecting decision-making. Research demonstrates significant variability in human following behavior, with aggressive drivers maintaining shorter headways of 1.096-1.590 seconds while conservative drivers maintain larger headways of 2.239-2.745 seconds (Wen et al., 2022). Aggressive drivers compensate for shorter headways by adopting higher deceleration during emergencies and higher acceleration to return to desired speeds. This driving behaviour creates a chain reaction where following vehicles must brake even harder, causing stop-and-go waves that spread through traffic and reduce traffic flow efficiency. In contrast, AVs can maintain shorter headways than human drivers with better precision and faster reaction time (Park et al., 2021). V2V communication technology and Light Detection and Ranging (LIDAR) provides information about the surrounding environment that allows better precision and decision-making of AVs, improving the traffic flow efficiency and capacity (Hussain and Zeadally, 2019; Park et al., 2021). Studies found that 75% of traffic accidents are caused by poor decision making in lane-changing, which emphasized the importance of lane-changing decisions in traffic stability and traffic efficiency (Shimojo et al., 2022); Liu et al., 2017).
4.3 Lane-changing behaviour
Lane-changing gap thresholds vary considerably among individuals. Most human drivers require at least 15 meters of rear clearance and faster speed than vehicles on desired lanes before changing lanes, but aggressive drivers will accept risker and smaller gaps when encountering slow traffic or slow vehicles (Liu et al., 2017). Moreover, Shimojo and other researchers (2022) found that aggressive drivers tend to experience frustrations when encountering interference during lane merging, especially when they believe that they have the right ofway to merge, resulting in retaliatory behaviours that compromise safety. The combination of risk-taking gap acceptance and retaliatory behaviours results in substantially higher accident rates, with aggressive and moderately aggressive drivers experiencing crash rates that are 5.10 and 2.83 times higher, respectively, as compared to non- aggressive drivers (Adavikottu & Velaga, 2024). In contrast, AVs employs algorithmic decision-making processes that integrates radar, LiDAR systems, and ultrasonic sensors to detect the surrounding environment (Ondruš et al., 2020). With these technologies, it enables more precise decision-making for lane-changing, which potentially prevent about 4-10% of human-error related accidents (Faisal et al., 2019). Conversely, cooperative lane-changing of AVs show potential for improving traffic stability, efficiency, and overall flow optimization.
5 Development and Implementation Summary
The simulation will be developed using Python as the primary programming language, chosen for its extensive libraries, ease of implementing complex behavioural algorithms, and strong support for data analysis. Pygame will be used to create the visual display and user control, chosen for its simplicity in making 2D graphics and interactive programs. The code will be written using Visual Studio Code, with Git to save different versions and track changes throughout the project.
The implementation will use object-oriented design with separate classes for different vehicle types (HumanDrivenVehicle, AutonomousVehicle) and core components(TrafficSimulation, Road, DataCollector). Each vehicle class will encapsulate specific behavioural algorithms for reaction times, following distances, and lane-changing decisions based on research findings. The simulation will employ a discrete-time approach, updating vehicle positions and behaviours at regular intervals for smooth real-time movements.
Development will follow an iterative workflow, beginning with basic vehicle movement and progressively adding behavioural complexity. First, basic vehicles will be added to the road and made to move. Then, realistic human driving behaviours will be programmed, followed by autonomous car behaviours, and finally tools to compare the results. Each step will be tested to make sure the cars behave realistically based on research findings. Data collection and visualization components will be integrated continuously, with performance optimization in final phases to efficiently handle larger vehicle numbers. This structured approach allows for systematic development while maintaining code quality and ensuring the simulation accurately reflects real-world driving behaviours.
6 Data source
I confirm that no data will be used in this project, hence, this section does not apply to my project.
7 Testing and evaluation
The simulation will be tested by setting up specific situations and checking if the vehicles behave correctly. I will also test the program with different numbers of cars to see how many cars the program can handle before slowing down. Python testing tools will be used to automatically check that each part of the code works properly.
The simulation will be evaluated by comparing results with the research findings. Traffic metrics, such as average speed, accelerations will be measured across different AV penetration rates and compared against expected improvements.
8 UI/UX mockup
9 Project ethics and human participants
I confirm that no human data or human participants is required for this project, thus, this section does not apply to this project.
10 BCS project criteria
1. An ability to apply practical and analytical skills gained during the degree programme.
The project will utilise practical and analytical skills from my degree, including Python programming for simulation development, object-oriented design principles for creating vehicle behavioural models, data analysis techniques for processing traffic metrics, and mathematical modelling to implement research-based behavioural algorithms.
2. Innovation and/ or creativity
The project involves creating real-time visualisation tool that combines established traffic research with interactive simulation technology. This creative approach allows dynamic observation and comparison of both human and autonomous vehicle behaviours, providing an innovative educational and analytical platform. for understanding mixed traffic scenarios.
3. Synthesis of information, ideas and practices to provide a quality solution together with an evaluation of that solution.
This project synthesizes traffic engineering research, behavioural psychological studies, and autonomous vehicle technology literature to create a comprehensive simulation model. This integration provides a quality solution that will be evaluated through systematic testing against research benchmarks.
4. That your project meets a real need in a wider context.
With autonomous vehicles entering real-world deployment, transportation planners, and policymakers need practical tools to predict and analyse mixed traffic scenarios. This simulation addresses the genuine need for evidence-based decision-making tools regarding AV adoption and traffic management strategies.
5. An ability to self-manage a significant piece of work.
The project demonstrates self-management through structured development planning, iterative implementation phases, systematic risk management, and independent organization of a complex long-term software development project with multiple technical and research components.
6. Critical self-evaluation of the process.
Critical evaluation will occur through regular testing phases, systematic comparison with research literature, user feedback analysis, and continuous reflection on development challenges, solutions, and project outcomes throughout the development lifecycle.
11 Project plan
12 Risks and contingency plans
Risks |
Contingencies |
Likelihood |
Impact |
Hardware failure |
Maintain regular backups on cloud storage (Dropbox, GoogleDrive) and external drives. |
Low |
High |
Running out of time for development |
Create detailed project timeline with buffer time. Prioritise essential features over desirable ones. Start with simple implementation and add complexity gradually |
Medium |
High |
Pygame compatibility or technical issues |
Test early and frequent. Have alternative visualisation approaches ready. Consider switching to simpler graphics if needed. |
Low |
Medium |
References
Adavikottu, A. and Velaga, N.R. (2024) ‘Modeling the impact of driving aggression on lane
change performance measures: Steering compensatory behavior, Lane change
execution duration and crash probability’, Transportation Research Part F: Traffic
Psychology and Behaviour, 103, pp. 526–553. doi:10.1016/j.trf.2024.05.001.
Biswas, R.K. et al. (2021) ‘A systematic review of definitions of motor vehicle headways in driver behaviour and performance studies’, Transportation Research Part F: Traffic Psychology and Behaviour, 77, pp. 38–54. doi:10.1016/j.trf.2020.12.011.
Calvert, S.C., Schakel, W.J. and van Lint, J.W. (2017) ‘Will automated vehicles negatively
impact traffic flow?’, Journal of Advanced Transportation, 2017, pp. 1–17.
doi:10.1155/2017/3082781.
Faisal, A. et al. (2019) ‘Understanding autonomous vehicles: A systematic literature review on capability, impact, planning and policy’, Journal of Transport and Land Use, 12(1). doi:10.5198/jtlu.2019.1405.
Hussain, R. and Zeadally, S. (2019) ‘Autonomous cars: Research results, issues, and future challenges’, IEEE Communications Surveys & Tutorials, 21(2), pp. 1275–1313. doi:10.1109/comst.2018.2869360.
Liu, Y. et al. (2017) ‘Characteristic analysis of mixed traffic flow of regular and autonomous vehicles using cellular automata’, Journal of Advanced Transportation, 2017, pp. 1–10. doi:10.1155/2017/8142074.
Ondruš, J. et al. (2020) ‘How do autonomous cars work?’, Transportation Research Procedia, 44, pp. 226–233. doi:10.1016/j.trpro.2020.02.049.
Park, J.E. et al. (2021) ‘The impact of automated vehicles on traffic flow and road capacity
on Urban Road Networks’, Journal of Advanced Transportation, 2021, pp. 1–10.
doi:10.1155/2021/8404951.
Poliak, M. et al. (2022) ‘Driver response time and age impact on the reaction time of drivers:
A driving simulator study among professional-truck drivers’, Mathematics, 10(9), p.
1489. doi:10.3390/math10091489.
Rydzewski, A. and Czarnul, P. (2021) ‘Human awareness versus autonomous vehicles view:
Comparison of reaction times during emergencies’, 2021 IEEE Intelligent Vehicles Symposium (IV), pp. 732–739. doi:10.1109/iv48863.2021.9575602.
Shimojo, A. et al. (2022a) ‘How impressions of other drivers affect one’s behavior. when merging lanes’, Transportation Research Part F: Traffic Psychology and Behaviour, 89, pp. 236–248. doi:10.1016/j.trf.2022.06.007.
Shimojo, A. et al. (2022b) ‘How impressions of other drivers affect one’s behavior. when merging lanes’, Transportation Research Part F: Traffic Psychology and Behaviour, 89, pp. 236–248. doi:10.1016/j.trf.2022.06.007.
Wen, X., Cui, Z. and Jian, S. (2022) ‘Characterizing car-following behaviors of human drivers when following automated vehicles using the real-world dataset’, Accident Analysis & Prevention, 172, p. 106689. doi:10.1016/j.aap.2022.106689.