B14 Documentation

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 38

A Real Time Research Project/ Societal Related Project Report

On
SMART TRAFFIC AUTOMATION SYSTEM
Submitted in fulfillment of the requirements for the award of the
Bachelor of Technology
In
Department of Information and Technology
By
Sammith Reddy 22241A12C6
Lakshmi Narayana Raju 22241A12
Snehith Reddy 23241A1209
Dinesh Reddy 22241A12B5

Under the Esteemed guidance of

Dr. V. Akila
Associate Professor

Department of Information and Technology


GOKARAJU RANGARAJU INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Autonomous)

Bachupally, Kukatpally, Hyderabad,Telangana,India,500090


2023-2024

I
GOKARAJU RANGARAJU
INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Autonomous)

CERTIFICATE

This is to certify that the Real Time Research Project/ Societal Related Project entitled “Smart
Traffic Automation System ” is submitted by Sammith Reddy(22241A12C6) , Snehith Reddy
(23241A1209) , Lakshmi Narayana Raju (22241A1279), Dinesh Reddy (22241A12B5) in
fulfillment of the award of a degree in BACHELOR OF TECHNOLOGY in Computer Science and
Engineering during the academic year 2023-2024.

INTERNAL GUIDE HEAD OF THE DEPARTMENT


Dr. V. AKILA Dr. B. SANKARA BABU
Associate Professor Professor

II
Many people helped us directly and indirectly to complete our project successfully. We would like
to take this opportunity to thank one and all. First, we wish to express our deep gratitude to our
internal guide Dr. V. Akila , Associate Professor, Department of IT for his/her support in the
completion of our project report. We wish to express our honest and sincere thanks to Bharathi
mam for coordinating in conducting the project reviews, Dr.Y Jeevan Nagendra kumar , HOD,
Department of IT for providing resources, and to the principal Dr. J. Praveen for providing the
facilities to complete our Real Time Research Project/ Societal Related Project. We would like to
thank all our faculty and friends for their help and constructive criticism during the project
completion phase. Finally, we are very much indebted to our parents for their moral support and
encouragement to achieve goals.

Sammith Reddy (22241A12C6)


Lakshmi Narayana Raju (22241A12)
Snehith Reddy (22241A12)
Dinesh Reddy (22241A12B5)

III
DECLARATION

We hereby declare that the Real Time Research Project/ Societal Related Project entitled “Smart
Traffic Automation System” is the work done during the period from 2023-2024 and is submitted
in the fulfillment of the requirements for the award of the degree of Bachelor of Technology in
Information and Technology from Gokaraju Rangaraju Institute of Engineering and Technology
(Autonomous under Jawaharlal Nehru Technology University, Hyderabad). The results
embodied in this project have not been submitted to any other university or Institution for the award
of any degree or diploma.

Sammith Reddy (22241A12C6)


Lakshmi Narayana Raju (22241A12)
Snehith Reddy (22241A12)
Dinesh Reddy (22241A12B5)

IV
V
Table of Contents

Chapter Title Page No.

Abstract 1

1 Introduction 2

2 System Requirements 5

2.1 Software Requirements 5

2.2 Hardware Requirements 7

2.3 Data Set 8

3 Literature Survey 9

4 Proposed Model, Modules Description, and UML Diagrams 17

4.1 Modules 19

4.2 UML Diagrams 20

5 Implementation, Experimental Results &Test Cases 24

6 Conclusion and Future Scope 35

7 References 37

Appendix
38
Snapshot of the Result of ML model
39
Result of API

VI
LIST OF FIGURES
Fig. No. Title Page No.

4.2.1 Use Case Diagram 20

4.2.2 Class Diagram 21

4.2.3 Sequence Diagram 22

4.2.4 Component Diagram 23

5.2.1 Login Page 31

5.2.2 Detection page 31

5.2.3 Test case 1 32

5.2.4 Test case 2 32

5.2.5 Test case 3 33

5.2.6 Test case 4 33

5.2.7 Test case 5 34

LIST OF TABLES
Table No. Table Name Page No.
5.3 Test Cases 34

VII
ABSTRACT
In today's rapidly urbanizing world, efficient traffic management systems are critical for ensuring safe and
smooth transportation flow in cities. The increasing number of vehicles on roads coupled with limited
infrastructure poses significant challenges to urban mobility and safety. To address these challenges, the
development of advanced traffic management systems has become essential. A Traffic Management System is
a comprehensive solution that integrates various technologies, including cameras, communication networks,
and intelligent algorithms, to monitor, control, and optimize traffic flow in real-time. This abstract focuses on
the key components and functionalities of a TMS and its benefits in improving urban traffic management.

Here we build simulator application to provide sample features such as scenario creation, visualization.
Simulator application is a software tool designed to mimic the behaviour of real world systems or processes in
a virtual environment. It is updated with entering coordinates and destination of each and every car driver
entering, also provides each car to travel to the destination in shortest path and shortest time. It is built in such
a way that the traffic lights are dynamic and are reactive to the weightage of cars in each lane and road. In this
we use the concepts like Networking, Image processing, GUI/simulator development and softwares like
GUL/simulator Development [python], Image/video processing [opencv using python ,Microsoft visual code],
Data Analysis [algorithms].

Cloud computing technologies may be utilized for hosting the simulator application, storing simulation data,
and scaling computational resources as needed. Cloud platforms like AWS, Google Cloud Platform, or
Microsoft Azure provide services for hosting applications, managing data, and performing distributed
computing tasks. These technologies work together to enable the monitoring, analysis, control, and
optimization of traffic flow in urban and highway environments, ultimately improving safety, efficiency, and
sustainability of transportation systems

1
CHAPTER 1
INTRODUCTION

As urban areas continue to expand and the number of vehicles on the road increases, managing traffic
efficiently has become a paramount concern. Traditional traffic control methods, such as fixed-timed
traffic signals and manual monitoring, are no longer sufficient to handle the complexity and volume of
modern traffic. Advanced Traffic Management Systems (TMS) have emerged as a solution, utilizing a
combination of hardware and software technologies to manage traffic flow, reduce congestion, and
enhance road safety. These systems are designed to collect data from various sources, analyze it in real-
time, and make intelligent decisions to optimize traffic flow.

A fundamental component of any advanced TMS is its ability to monitor traffic in real-time. Surveillance
systems, including cameras and sensors, are strategically placed at intersections, highways, and other
critical points to provide continuous data on traffic conditions. These systems capture various metrics,
such as vehicle counts, speeds, and congestion levels. The data collected by these devices is transmitted
to a central processing unit where it is analyzed to detect patterns, identify bottlenecks, and predict traffic
trends. This real-time monitoring allows for immediate response to traffic incidents, improving overall
traffic management efficiency.

Effective communication is vital for the functioning of a TMS. Robust communication networks are
required to transmit data from surveillance systems to central control units and to disseminate information
back to drivers and traffic signals. These networks ensure that data flows seamlessly between different
components of the TMS. Wireless communication technologies, such as 4G/5G and dedicated short-range
communications (DSRC), are often used to enable real-time data exchange. This connectivity is crucial
for dynamic traffic signal control, where traffic lights adjust their timings based on current traffic
conditions to optimize flow and reduce delays.

At the core of a TMS are intelligent algorithms that analyze the collected data and make decisions to
manage traffic. These algorithms utilize advanced techniques, including machine learning and artificial
intelligence, to process large volumes of data and generate actionable insights. For instance, predictive
algorithms can forecast traffic congestion and suggest alternative routes to drivers, while optimization

2
algorithms can adjust traffic signal timings to balance traffic loads across intersections. The integration of
these intelligent systems allows for proactive traffic management, where potential issues are addressed
before they escalate into major problems.

To develop and refine TMS, simulator applications play a critical role. A simulator application is a
software tool designed to mimic the behavior of real-world traffic systems in a virtual environment. This
allows for the testing and validation of different traffic management strategies without disrupting actual
traffic. The simulator can create various traffic scenarios, visualize traffic flow, and evaluate the
performance of different traffic control measures. By entering coordinates and destinations for each
vehicle, the simulator can calculate the shortest path and travel time, adjusting dynamically to changing
traffic conditions.

One of the innovative features of modern TMS is the use of dynamic traffic lights. Traditional traffic
signals operate on fixed schedules, which can lead to inefficiencies and increased congestion. Dynamic
traffic lights, on the other hand, are reactive to real-time traffic conditions. Using data from surveillance
systems and intelligent algorithms, these lights adjust their timings based on the weightage of cars in each
lane and on each road. This dynamic adjustment helps to optimize traffic flow, reduce waiting times, and
improve overall road efficiency. By continuously adapting to current conditions, dynamic traffic lights
contribute significantly to the smooth operation of urban traffic networks.

Cloud computing technologies offer significant advantages for hosting TMS applications. Cloud
platforms like AWS, Google Cloud Platform, and Microsoft Azure provide scalable resources for
managing the computational demands of real-time traffic management. These platforms offer services for
data storage, processing, and distribution, enabling the TMS to handle large volumes of traffic data
efficiently. By leveraging cloud computing, TMS can scale up or down based on demand, ensuring
optimal performance even during peak traffic periods. Additionally, cloud-based solutions facilitate the
deployment of updates and improvements to the TMS, ensuring that it remains responsive to evolving
traffic conditions.

The implementation of advanced TMS brings numerous benefits to urban traffic management. Improved
traffic flow reduces travel times and fuel consumption, contributing to environmental sustainability.
Enhanced monitoring and real-time response capabilities improve road safety by quickly addressing
incidents and preventing accidents. Dynamic traffic signal control and intelligent routing algorithms help
to minimize congestion, leading to more efficient use of existing infrastructure. Furthermore, the

3
integration of cloud computing and advanced analytics allows for continuous improvement of the system,
ensuring that it adapts to the changing needs of urban transportation.
In conclusion, the development of advanced Traffic Management Systems is essential for addressing the
challenges of urban mobility and safety in today's rapidly urbanizing world. By integrating technologies
such as surveillance systems, communication networks, intelligent algorithms, and cloud computing,
TMS can monitor, control, and optimize traffic flow in real-time. Simulator applications provide a
valuable tool for testing and refining these systems, ensuring that they operate efficiently and effectively.
The benefits of advanced TMS are manifold, including reduced congestion, improved safety, and
enhanced environmental sustainability. As cities continue to grow, the adoption and advancement of TMS
will play a crucial role in creating smarter, safer, and more efficient urban transportation networks.

1.1 EXISTING SYSTEM


Traffic Management Systems (TMS) have evolved significantly over the past few decades,
incorporating various technologies and methodologies to address the complexities of modern
urban traffic. These systems range from traditional fixed-time control systems to advanced
adaptive traffic control systems, each with its own set of functionalities and benefits.

1.1.1 LIMITATIONS OF THE EXISTING SYSTEM


 Humar Error and Inconsistency: Manual traffic management relies on human intervention,
which is prone to errors and inconsistencies. Traffic police officers managing intersections can
make mistakes, misjudge traffic flow, or become fatigued, leading to inefficient traffic control and
increased congestion.
 Limited Coverage and Scalability: Manual traffic control is limited in scope and scalability. It is
not feasible to deploy human traffic controllers at every intersection or road segment, especially in
large cities with extensive road networks. This limitation restricts the ability to manage traffic
effectively across the entire urban area.
 Inability to Handle Complex Traffic Patterns: As urban traffic becomes more complex with
varying patterns throughout the day, manual systems struggle to adapt dynamically. They cannot
efficiently handle fluctuating traffic volumes, peak hours, or unexpected incidents, resulting in
suboptimal traffic flow management.
 Fixed-Time Signal Control: Traditional electronic systems often use fixed-time signal control,
where traffic signals operate on predetermined schedules. While simple and cost-effective, fixed-
time signals do not adapt to real-time traffic conditions, leading to inefficiencies during peak

4
hours or unexpected traffic surges. This rigidity can result in unnecessary delays and increased
congestion.

5
CHAPTER 2
SYSTEM REQUIREMENTS
2.1 SOFTWARE REQUIREMENTS:
The software requirements for the project “Cyberbullying Detection Using Machine Learning” are
explained below:
1) Operating System – Windows:
Python tools and frameworks are well supported on Windows 10/11.

2)Python:
For data collection, preparation, and analysis in this project, Python is utilized with libraries like Pandas
and NumPy.
3)IDE (Integrated Development Environment):
VS Code has been used as the text editor and python has been installed
4)External Libraries:
 Pygame:
Pygame is used for game development due to its simplicity, ease of learning, and robust features. It
provides modules for graphics, sound, and input handling, enabling rapid prototyping and
development of 2D games. Its Python foundation ensures readability and extensive community
support.

2.2 HARDWARE REQUIREMENTS


The hardware requirements for the project “Cyberbullying Detection Using Machine Learning” are:
1)Processor (CPU):
To handle the computational needs of data preprocessing, feature extraction, and model training in
cyberbullying detection projects, a multi-core processor such as an Intel Core i5 or higher is essential.
Because of its effective parallel processing capabilities, jobs are completed on time, which speeds up
iteration cycles and model refining.
2)Memory (RAM):
The system can handle the substantial memory requirements of processing big text datasets and training
intricate machine learning models with a minimum of 8 GB RAM, avoiding performance loss brought on

6
by memory limitations. Sufficient RAM makes data manipulation easier and allows for a smoother
transition between preprocessing and model training, which boosts output and flexibility in
experimentation.
3)Graphics Processing Unit (GPU):
Although not required, adding a GPU—ideally one from the NVIDIA GeForce GTX or RTX serie
slightly speeds up the training of deep learning models by shifting computationally demanding tasks to
the GPU cores. This capacity for parallel processing promotes creativity and model optimisation by
accelerating convergence and facilitating quick testing with various neural network topologies.
4)Storage:
Can be minimum of 128 Gb would be ideal if it is more than that.

CHAPTER 3
LITERATURE SURVEY

Introduction

Traffic Management Systems (TMS) are essential for maintaining efficient and safe transportation
networks in urban areas. With increasing urbanization and the growing number of vehicles, traditional
traffic management methods have become inadequate. This literature survey reviews the evolution of
traffic management systems, focusing on their technological advancements, the integration of intelligent
systems, and the challenges faced in implementation.

1. Traditional Traffic Management Systems

 Fixed-Time Control Systems

Fixed-time control systems were among the first traffic management solutions implemented in urban
areas. These systems operate traffic signals based on predetermined schedules derived from historical
traffic data. Webster (1958) laid the groundwork for these systems, developing mathematical models to
optimize signal timings. Although these systems are cost-effective and simple, they are inflexible and
inefficient during variable traffic conditions, often leading to congestion during peak hours or unexpected
traffic surges.

 Actuated Traffic Control Systems

Actuated traffic control systems introduced more responsiveness compared to fixed-time systems. These
systems use sensors, such as inductive loop detectors, to detect the presence of vehicles at intersections.
Gartner (1983) highlighted that actuated systems adjust signal timings based on real-time traffic
conditions, providing better management of traffic flow than fixed-time systems. However, their
effectiveness is limited to individual intersections and does not account for network-wide traffic
conditions.

7
2. Adaptive Traffic Control Systems (ATCS):
 Introduction and Development

Adaptive Traffic Control Systems (ATCS) represent a significant advancement in traffic management by
dynamically adjusting signal timings based on real-time data. These systems aim to optimize traffic flow
across entire networks rather than just individual intersections.

 SCOOT and SCATS

Two prominent adaptive systems are the Split Cycle Offset Optimization Technique (SCOOT) and the
Sydney Coordinated Adaptive Traffic System (SCATS). SCOOT, developed in the UK, continuously
updates signal timings using data from vehicle detectors. Research by Bretherton et al. (2005)
demonstrated that SCOOT reduces delays and stops by up to 20% compared to fixed-time systems.
SCATS, developed in Australia, uses a decentralized approach to optimize traffic flow. Sims and
Dobinson (1980) found that SCATS significantly reduces travel times and improves traffic flow
efficiency.

 Other Adaptive Systems

Other adaptive systems include the Traffic Responsive Urban Control (TUC) system, implemented in
cities like Munich and Athens. TUC uses a model-based approach to optimize signal timings,
demonstrating significant improvements in traffic flow and congestion reduction (Diakaki et al., 2002).

3. Intelligent Transportation Systems (ITS):


 Overview

Intelligent Transportation Systems (ITS) integrate information and communication technologies into
transportation infrastructure to enhance efficiency and safety. ITS applications range from traffic
management to traveler information and vehicle control systems (Chen et al., 2017).

 Data Collection and Analysis

ITS relies on extensive data collection from various sources, including traffic cameras, sensors, GPS
devices, and social media. Advanced algorithms and machine learning techniques analyze this data to
generate actionable insights (Barceló, 2010). For instance, traffic flow prediction models forecast
congestion and suggest alternative routes, while optimization algorithms adjust traffic signal timings to
balance traffic loads.

 Connected and Autonomous Vehicles

Connected and autonomous vehicles (CAVs) represent a significant advancement in ITS. CAVs can
communicate with each other and with infrastructure, sharing real-time data on traffic conditions and road
hazards (Zhou et al., 2020). Talebpour and Mahmassani (2016) showed that CAVs could improve traffic
flow and reduce congestion by up to 30%.

 Dynamic Toll Pricing

Dynamic toll pricing adjusts toll rates based on real-time traffic conditions to manage demand and reduce
congestion. Brownstone and Small (2005) studied High-Occupancy Toll (HOT) lanes in the United

8
States, finding that dynamic pricing effectively manages traffic demand and improves overall network
efficiency.

4. Cloud-Based Traffic Management Systems


 Advantages of Cloud Computing

Cloud computing offers greater scalability, flexibility, and integration with other technologies for traffic
management systems. Cloud platforms like Amazon Web Services (AWS), Google Cloud Platform, and
Microsoft Azure provide the infrastructure and services needed to support large-scale traffic management
applications (Mollah et al., 2017).

 Real-Time Data Processing

Cloud-based traffic management systems can process vast amounts of data in real-time, enabling accurate
and timely decision-making. The computational power of the cloud handles complex algorithms and large
data sets efficiently, providing real-time insights into traffic conditions (Botta et al., 2016).

 Scalability and Flexibility

One key benefit of cloud-based systems is their scalability. Cloud-based systems can scale up or down
based on traffic volumes, ensuring optimal performance even during peak periods (Liu et al., 2018).
These solutions also facilitate the deployment of updates and improvements, allowing systems to adapt to
evolving traffic conditions and technological advancements.

 Case Studies

Cities like Los Angeles and Barcelona have successfully implemented cloud-based traffic management
systems. Los Angeles uses a cloud-based platform to monitor and manage traffic signals across its
extensive road network, collecting real-time data from sensors and cameras and adjusting signal timings
to optimize traffic flow (Smith et al., 2013). Barcelona's cloud-based system integrates data from public
transportation, parking, and environmental sensors, providing a comprehensive view of urban mobility
(Muñoz et al., 2015).

5. Simulation and Modeling in Traffic Management


 Importance of Simulation

Simulation and modeling are crucial in developing and evaluating traffic management systems. By
creating virtual models of real-world traffic scenarios, researchers can test and refine different strategies
without disrupting actual traffic (Barceló, 2010).

 Traffic Simulation Tools

Several traffic simulation tools support traffic management research and practice. VISSIM, a microscopic
traffic simulation software, models individual vehicle movements and interactions within a traffic
network (PTV Group, 2019). SUMO (Simulation of Urban MObility) is an open-source traffic simulation
tool that supports large-scale scenarios and integrates with various data sources (Krajzewicz et al., 2012).

 Applications of Simulation

9
Traffic simulation tools evaluate traffic signal control strategies, assess infrastructure improvements, and
analyze traffic impacts from new developments. Researchers have used simulation to evaluate the
effectiveness of adaptive traffic signal control systems, demonstrating significant improvements in traffic
flow and congestion reduction (Stevanovic et al., 2008).

 Case Studies

In Toronto, researchers used a simulation model to evaluate the impact of an adaptive traffic signal
control system on a major arterial road. Results showed a reduction in travel times and delays,
highlighting the potential benefits of adaptive systems (Abdelgawad et al., 2011). Similarly, in Singapore,
a simulation-based approach optimized the deployment of connected and autonomous vehicles,
demonstrating improvements in traffic flow and safety (Qian et al., 2019).

6. Challenges and Limitations


 Data Quality and Reliability

Ensuring data quality and reliability is a primary challenge in traffic management. Inaccurate or
incomplete data can lead to suboptimal decisions, reducing system effectiveness (Zheng et al., 2014).
Ensuring data accuracy requires robust sensor networks and reliable communication infrastructure, which
can be costly and complex to implement.

 Integration of Technologies

Integrating multiple technologies into a cohesive traffic management system poses significant challenges.
Different components, such as sensors, cameras, and communication networks, often come from various
manufacturers and use different protocols, leading to compatibility issues (Chen et al., 2017). Effective
integration requires standardized interfaces and protocols, as well as robust data management practices.

 Scalability and Cost

Scalability is a critical concern for traffic management systems, particularly in rapidly growing urban
areas. Expanding systems to accommodate increasing traffic volumes requires significant investment in
infrastructure and technology (Liu et al., 2018). Cost constraints often limit the implementation of
comprehensive traffic management solutions, especially in developing regions.

 Environmental and External Factors

Environmental factors, such as weather conditions, can affect the performance of traffic management
systems. For example, heavy rain, snow, or fog can disrupt sensor accuracy and data transmission,
reducing system reliability (Fang et al., 2020). Additionally, external factors like road construction,
accidents, and events can introduce unpredictability, challenging traffic management systems to adapt
swiftly.

7. Future Directions
 Advanced Data Analytics and Machine Learning

The future of traffic management systems lies in advanced data analytics and machine learning. These
technologies can enhance predictive capabilities, optimize traffic flow, and improve decision-making
processes. By analyzing large volumes of historical and real-time data, machine learning algorithms can
identify patterns and trends, enabling proactive traffic management (Tang et al., 2019).

10
 Internet of Things (IoT) Integration

Integrating the Internet of Things (IoT) into traffic management systems will significantly enhance data
collection and analysis. IoT devices, such as connected vehicles, smart traffic lights, and infrastructure
sensors, can provide real-time data, improving situational awareness and responsiveness (Li et al., 2020).

 Autonomous and Connected Vehicle Technologies

The proliferation of autonomous and connected vehicle technologies will transform traffic management.
Autonomous vehicles can operate more efficiently and safely than human drivers, while connected
vehicles can communicate with each other and with traffic management systems to optimize traffic flow
and reduce congestion (Gkartzonikas and Gkritza, 2019).

 Blockchain for Data Security and Privacy

Blockchain technology can address data security and privacy concerns in traffic management systems. By
providing a decentralized and tamper-proof ledger, blockchain can ensure the integrity and confidentiality
of traffic data, facilitating secure data sharing and collaboration (Kshetri, 2017).

8. Conclusion

Traffic management systems have evolved from simple fixed-time control systems to sophisticated
adaptive and cloud-based solutions. The integration of intelligent transportation systems, real-time data
processing, and advanced simulation tools has significantly enhanced the efficiency and effectiveness of
traffic management. However, challenges related to data quality, technological integration, scalability,
and environmental factors remain. Future advancements in data analytics, IoT, autonomous vehicles, and
blockchain technology hold the potential to further revolutionize traffic management, making urban
transportation systems more efficient, safe, and sustainable.

9. References

 Abdelgawad, H., et al. (2011). "Evaluating the impact of an adaptive traffic signal control system
in Toronto, Canada." Journal of Transportation Engineering.
 Barceló, J. (2010). Fundamentals of Traffic Simulation. Springer.
 Botta, A., et al. (2016). "Integration of cloud computing and internet of things: A survey." Future
Generation Computer Systems.
 Bretherton, R. D., et al. (2005). "SCOOT—The world's leading adaptive traffic control system."
Proceedings of the Institution of Civil Engineers - Transport.
 Brownstone, D., & Small, K. A. (2005). "Valuing time and reliability: Assessing the evidence
from road pricing demonstrations." Transportation Research Part A: Policy and Practice.
 Chen, X., et al. (2017). "A survey of traffic management in smart cities." IEEE Communications
Surveys & Tutorials.
 Diakaki, C., et al. (2002). "Integrated traffic-responsive urban corridor control strategy in the city
of Chania." Transportation Research Part C: Emerging Technologies.
 Fang, Y., et al. (2020). "Impact of adverse weather on traffic speed: a comparative study of urban
roads and highways." Transportation Research Part D: Transport and Environment.
 Gartner, N. H. (1983). "Development and evaluation of the traffic-responsive control algorithm."
Transportation Research Record.

11
 Gkartzonikas, C., & Gkritza, K. (2019). "What have we learned? A review of stated preference
and choice studies on autonomous vehicles." Transportation Research Part C: Emerging
Technologies.
 Hunt, P. B., et al. (1982). "The SCOOT on-line traffic signal optimization technique." Traffic
Engineering & Control.
 Krajzewicz, D., et al. (2012). "Recent development and applications of SUMO - Simulation of
Urban MObility." International Journal On Advances in Systems and Measurements.
 Kshetri, N. (2017). "Can blockchain strengthen the internet of things?" IT Professional.
 Li, Y., et al. (2020). "Internet of Things (IoT) in smart transportation: Applications and
challenges." IEEE Transactions on Intelligent Transportation Systems.
 Liu, J., et al. (2018). "Scalable cloud-based traffic management system for urban areas." Journal
of Cloud Computing.
 Lowrie, P. R. (1990). "SCATS: The Sydney Coordinated Adaptive Traffic System - Principles,
methodology, algorithms." Proceedings of the Institution of Civil Engineers - Transport.
 Mollah, M. B., et al. (2017). "Cloud computing and its applications in the world of networking."
International Journal of Computer Science and Information Technology Research.
 Muñoz, L., et al. (2015). "Smart city initiatives: The case of Barcelona." Journal of the
Knowledge Economy.
 PTV Group. (2019). VISSIM 2020 User Manual.
 Qian, X., et al. (2019). "Simulation-based optimization approach for connected and autonomous
vehicle deployment in Singapore." Transportation Research Record.
 Sims, A. G., & Dobinson, K. W. (1980). "The Sydney Coordinated Adaptive Traffic System
(SCATS) - A traffic responsive method for controlling urban traffic." Proceedings of the
Institution of Civil Engineers - Transport.
 Smith, B., et al. (2013). "Real-time traffic management using a cloud-based platform." IEEE
Transactions on Intelligent Transportation Systems.
 Stevanovic, A., et al. (2008). "Adaptive traffic control system deployment: Field test results and
findings." Transportation Research Record.
 Talebpour, A., & Mahmassani, H. S. (2016). "Influence of connected and autonomous vehicles on
traffic flow stability and throughput." Transportation Research Part C: Emerging Technologies.
 Tang, J., et al. (2019). "Machine learning for traffic flow prediction: A survey." IEEE
Transactions on Intelligent Transportation Systems.
 Webster, F. V. (1958). "Traffic signal settings." Road Research Technical Paper No. 39.

12
4. IMPLEMENTATION, EXPERIMENTAL RESULTS &
TEST CASES
4.1 Implementation
5 # LAG
6 # NO. OF VEHICLES IN SIGNAL CLASS
7 # stops not used
8 # DISTRIBUTION
9 # BUS TOUCHING ON TURNS
10 # Distribution using python class
11
12 # *** IMAGE XY COOD IS TOP LEFT
13 import random
14 import math
15 import time
16 import threading
17 # from vehicle_detection import detection
18 import pygame
19 import sys
20 import os
21

22 # Default values of signal times


23 defaultRed = 150
24 defaultYellow = 3
25 defaultGreen = 20
26 defaultMinimum = 10
27 defaultMaximum = 60
28
29 signals = []
30 noOfSignals = 4
31 simTime = 500 # change this to change time of simulation
32 timeElapsed = 0
33
34 currentGreen = 0 # Indicates which signal is green
35 nextGreen = (currentGreen+1)%noOfSignals
36 currentYellow = 0 # Indicates whether yellow signal is on or off
37

38 carTime = 1.25
39 bikeTime = 1
40 rickshawTime = 1.5
41 busTime = 1.8
42 truckTime = 2
43
44 noOfCars = 0
45 noOfBikes = 0

13
46 noOfBuses =0
47 noOfTrucks = 0
48 noOfRickshaws = 0
49 noOfLanes = 2
50
51 detectionTime = 5
52
53 #speeds = {'car':2.5, 'bus':2.2, 'truck':1.9, 'rickshaw':2.1, 'bike':2.5}
54 speeds = {'car':1.5, 'bus':1.2, 'truck':.9, 'rickshaw':1.1, 'bike':1.5}
55 x = {'right':[0,0,0], 'down':[755,727,697], 'left':[1400,1400,1400], 'up':
[602,627,657]}
56 y = {'right':[348,370,398], 'down':[0,0,0], 'left':[498,466,436], 'up':[800,800,800]}
57
58 vehicles = {'right': {0:[], 1:[], 2:[], 'crossed':0}, 'down': {0:[], 1:[], 2:[],
'crossed':0}, 'left': {0:[], 1:[], 2:[], 'crossed':0}, 'up': {0:[], 1:[], 2:[],
'crossed':0}}
59 vehicleTypes = {0:'car', 1:'bus', 2:'truck', 3:'rickshaw', 4:'bike'}
60 directionNumbers = {0:'right', 1:'down', 2:'left', 3:'up'}
61
62 # Coordinates of signal image, timer, and vehicle count
63 signalCoods = [(530,230),(810,230),(810,570),(530,570)]
64 signalTimerCoods = [(530,210),(810,210),(810,550),(530,550)]
65 vehicleCountCoods = [(480,210),(880,210),(880,550),(480,550)]
66 vehicleCountTexts = ["0", "0", "0", "0"]
67
68 # Coordinates of stop lines
69 stopLines = {'right': 590, 'down': 330, 'left': 800, 'up': 535}
70 defaultStop = {'right': 580, 'down': 320, 'left': 810, 'up': 545}
71 stops = {'right': [580,580,580], 'down': [320,320,320], 'left': [810,810,810], 'up':
[545,545,545]}
72
73 mid = {'right': {'x':705, 'y':445}, 'down': {'x':695, 'y':450}, 'left': {'x':695,
'y':425}, 'up': {'x':695, 'y':400}}
74 rotationAngle = 3
75
76 # Gap between vehicles
77 gap = 15 # stopping gap
78 gap2 = 15 # moving gap
79
80 pygame.init()
81 simulation = pygame.sprite.Group()
82
83 class TrafficSignal:
84 def __init__(self, red, yellow, green, minimum, maximum):
85 self.red = red
86 self.yellow = yellow
87 self.green = green
88 self.minimum = minimum

14
89 self.maximum = maximum
90 self.signalText = "30"
91 self.totalGreenTime = 0
92 class Vehicle(pygame.sprite.Sprite):
93 def __init__(self, lane, vehicleClass, direction_number, direction, will_turn):
94 pygame.sprite.Sprite.__init__(self)
95 self.lane = lane
96 self.vehicleClass = vehicleClass
97 self.speed = speeds[vehicleClass]
98 self.direction_number = direction_number
99 self.direction = direction
100 self.x = x[direction][lane]
101 self.y = y[direction][lane]
102 self.crossed = 0
103 self.willTurn = will_turn
104 self.turned = 0
105 self.rotateAngle = 0
106 vehicles[direction][lane].append(self)
107 # self.stop = stops[direction][lane]
108 self.index = len(vehicles[direction][lane]) - 1
109 path = "images/" + direction + "/" + vehicleClass + ".png"
110 self.originalImage = pygame.image.load(path)
111 self.currentImage = pygame.image.load(path)
112
113
114 if(direction=='right'):
115 if(len(vehicles[direction][lane])>1 and vehicles[direction][lane]
[self.index-1].crossed==0): # if more than 1 vehicle in the lane of vehicle before
it has crossed stop line
116 self.stop = vehicles[direction][lane][self.index-1].stop -
vehicles[direction][lane][self.index-1].currentImage.get_rect().width - gap #
setting stop coordinate as: stop coordinate of next vehicle - width of next vehicle -
gap
117 else:
118 self.stop = defaultStop[direction]
119 # Set new starting and stopping coordinate
120 temp = self.currentImage.get_rect().width + gap
121 x[direction][lane] -= temp
122 stops[direction][lane] -= temp
123 elif(direction=='left'):
124 if(len(vehicles[direction][lane])>1 and vehicles[direction][lane]
[self.index-1].crossed==0):
125 self.stop = vehicles[direction][lane][self.index-1].stop +
vehicles[direction][lane][self.index-1].currentImage.get_rect().width + gap
126 else:
127 self.stop = defaultStop[direction]
128 temp = self.currentImage.get_rect().width + gap
129 x[direction][lane] += temp

15
130 stops[direction][lane] += temp
131 elif(direction=='down'):
132 if(len(vehicles[direction][lane])>1 and vehicles[direction][lane]
[self.index-1].crossed==0):
133 self.stop = vehicles[direction][lane][self.index-1].stop -
vehicles[direction][lane][self.index-1].currentImage.get_rect().height - gap
134 else:
135 self.stop = defaultStop[direction]
136 temp = self.currentImage.get_rect().height + gap
137 y[direction][lane] -= temp
138 stops[direction][lane] -= temp
139 elif(direction=='up'):
140 if(len(vehicles[direction][lane])>1 and vehicles[direction][lane]
[self.index-1].crossed==0):
141 self.stop = vehicles[direction][lane][self.index-1].stop +
vehicles[direction][lane][self.index-1].currentImage.get_rect().height + gap
142 else:
143 self.stop = defaultStop[direction]
144 temp = self.currentImage.get_rect().height + gap
145 y[direction][lane] += temp
146 stops[direction][lane] += temp
147 simulation.add(self)
148
149 def render(self, screen):
150 screen.blit(self.currentImage, (self.x, self.y))
151
152 def move(self):
153 if(self.direction=='right'):
154 if(self.crossed==0 and
self.x+self.currentImage.get_rect().width>stopLines[self.direction]): # if the
image has crossed stop line now
155 self.crossed = 1
156 vehicles[self.direction]['crossed'] += 1
157 if(self.willTurn==1):
158 if(self.crossed==0 or
self.x+self.currentImage.get_rect().width<mid[self.direction]['x']):
159 if((self.x+self.currentImage.get_rect().width<=self.stop or
(currentGreen==0 and currentYellow==0) or self.crossed==1) and (self.index==0 or
self.x+self.currentImage.get_rect().width<(vehicles[self.direction][self.lane]
[self.index-1].x - gap2) or vehicles[self.direction][self.lane][self.index-
1].turned==1)):
160 self.x += self.speed
161 else:
162 if(self.turned==0):
163 self.rotateAngle += rotationAngle
164 self.currentImage =
pygame.transform.rotate(self.originalImage, -self.rotateAngle)
165 self.x += 2

16
166 self.y += 1.8
167 if(self.rotateAngle==90):
168 self.turned = 1
169 # path = "images/" +
directionNumbers[((self.direction_number+1)%noOfSignals)] + "/" + self.vehicleClass +
".png"
170 # self.x = mid[self.direction]['x']
171 # self.y = mid[self.direction]['y']
172 # self.image = pygame.image.load(path)
173 else:
174 if(self.index==0 or
self.y+self.currentImage.get_rect().height<(vehicles[self.direction][self.lane]
[self.index-1].y - gap2) or
self.x+self.currentImage.get_rect().width<(vehicles[self.direction][self.lane]
[self.index-1].x - gap2)):
175 self.y += self.speed
176 else:
177 if((self.x+self.currentImage.get_rect().width<=self.stop or
self.crossed == 1 or (currentGreen==0 and currentYellow==0)) and (self.index==0 or
self.x+self.currentImage.get_rect().width<(vehicles[self.direction][self.lane]
[self.index-1].x - gap2) or (vehicles[self.direction][self.lane][self.index-
1].turned==1))):
178 # (if the image has not reached its stop coordinate or has crossed
stop line or has green signal) and (it is either the first vehicle in that lane or it
is has enough gap to the next vehicle in that lane)
179 self.x += self.speed # move the vehicle
180

181 elif(self.direction=='down'):
182 if(self.crossed==0 and
self.y+self.currentImage.get_rect().height>stopLines[self.direction]):
183 self.crossed = 1
184 vehicles[self.direction]['crossed'] += 1
185 if(self.willTurn==1):
186 if(self.crossed==0 or
self.y+self.currentImage.get_rect().height<mid[self.direction]['y']):
187 if((self.y+self.currentImage.get_rect().height<=self.stop or
(currentGreen==1 and currentYellow==0) or self.crossed==1) and (self.index==0 or
self.y+self.currentImage.get_rect().height<(vehicles[self.direction][self.lane]
[self.index-1].y - gap2) or vehicles[self.direction][self.lane][self.index-
1].turned==1)):
188 self.y += self.speed
189 else:
190 if(self.turned==0):
191 self.rotateAngle += rotationAngle
192 self.currentImage =
pygame.transform.rotate(self.originalImage, -self.rotateAngle)
193 self.x -= 2.5

17
194 self.y += 2
195 if(self.rotateAngle==90):
196 self.turned = 1
197 else:
198 if(self.index==0 or self.x>(vehicles[self.direction]
[self.lane][self.index-1].x + vehicles[self.direction][self.lane][self.index-
1].currentImage.get_rect().width + gap2) or self.y<(vehicles[self.direction]
[self.lane][self.index-1].y - gap2)):
199 self.x -= self.speed
200 else:
201 if((self.y+self.currentImage.get_rect().height<=self.stop or
self.crossed == 1 or (currentGreen==1 and currentYellow==0)) and (self.index==0 or
self.y+self.currentImage.get_rect().height<(vehicles[self.direction][self.lane]
[self.index-1].y - gap2) or (vehicles[self.direction][self.lane][self.index-
1].turned==1))):
202 self.y += self.speed
203
204 elif(self.direction=='left'):
205 if(self.crossed==0 and self.x<stopLines[self.direction]):
206 self.crossed = 1
207 vehicles[self.direction]['crossed'] += 1
208 if(self.willTurn==1):
209 if(self.crossed==0 or self.x>mid[self.direction]['x']):
210 if((self.x>=self.stop or (currentGreen==2 and currentYellow==0)
or self.crossed==1) and (self.index==0 or self.x>(vehicles[self.direction][self.lane]
[self.index-1].x + vehicles[self.direction][self.lane][self.index-
1].currentImage.get_rect().width + gap2) or vehicles[self.direction][self.lane]
[self.index-1].turned==1)):
211 self.x -= self.speed
212 else:
213 if(self.turned==0):
214 self.rotateAngle += rotationAngle
215 self.currentImage =
pygame.transform.rotate(self.originalImage, -self.rotateAngle)
216 self.x -= 1.8
217 self.y -= 2.5
218 if(self.rotateAngle==90):
219 self.turned = 1
220 # path = "images/" +
directionNumbers[((self.direction_number+1)%noOfSignals)] + "/" + self.vehicleClass +
".png"
221 # self.x = mid[self.direction]['x']
222 # self.y = mid[self.direction]['y']
223 # self.currentImage = pygame.image.load(path)
224 else:
225 if(self.index==0 or self.y>(vehicles[self.direction]
[self.lane][self.index-1].y + vehicles[self.direction][self.lane][self.index-

18
1].currentImage.get_rect().height + gap2) or self.x>(vehicles[self.direction]
[self.lane][self.index-1].x + gap2)):
226 self.y -= self.speed
227 else:
228 if((self.x>=self.stop or self.crossed == 1 or (currentGreen==2 and
currentYellow==0)) and (self.index==0 or self.x>(vehicles[self.direction][self.lane]
[self.index-1].x + vehicles[self.direction][self.lane][self.index-
1].currentImage.get_rect().width + gap2) or (vehicles[self.direction][self.lane]
[self.index-1].turned==1))):
229 # (if the image has not reached its stop coordinate or has crossed
stop line or has green signal) and (it is either the first vehicle in that lane or it
is has enough gap to the next vehicle in that lane)
230 self.x -= self.speed # move the vehicle
231 # if((self.x>=self.stop or self.crossed == 1 or (currentGreen==2 and
currentYellow==0)) and (self.index==0 or self.x>(vehicles[self.direction][self.lane]
[self.index-1].x + vehicles[self.direction][self.lane][self.index-
1].currentImage.get_rect().width + gap2))):
232 # self.x -= self.speed
233 elif(self.direction=='up'):
234 if(self.crossed==0 and self.y<stopLines[self.direction]):
235 self.crossed = 1
236 vehicles[self.direction]['crossed'] += 1
237 if(self.willTurn==1):
238 if(self.crossed==0 or self.y>mid[self.direction]['y']):
239 if((self.y>=self.stop or (currentGreen==3 and currentYellow==0)
or self.crossed == 1) and (self.index==0 or self.y>(vehicles[self.direction]
[self.lane][self.index-1].y + vehicles[self.direction][self.lane][self.index-
1].currentImage.get_rect().height + gap2) or vehicles[self.direction][self.lane]
[self.index-1].turned==1)):
240 self.y -= self.speed
241 else:
242 if(self.turned==0):
243 self.rotateAngle += rotationAngle
244 self.currentImage =
pygame.transform.rotate(self.originalImage, -self.rotateAngle)
245 self.x += 1
246 self.y -= 1
247 if(self.rotateAngle==90):
248 self.turned = 1
249 else:
250 if(self.index==0 or self.x<(vehicles[self.direction]
[self.lane][self.index-1].x - vehicles[self.direction][self.lane][self.index-
1].currentImage.get_rect().width - gap2) or self.y>(vehicles[self.direction]
[self.lane][self.index-1].y + gap2)):
251 self.x += self.speed
252 else:
253 if((self.y>=self.stop or self.crossed == 1 or (currentGreen==3 and
currentYellow==0)) and (self.index==0 or self.y>(vehicles[self.direction][self.lane]

19
[self.index-1].y + vehicles[self.direction][self.lane][self.index-
1].currentImage.get_rect().height + gap2) or (vehicles[self.direction][self.lane]
[self.index-1].turned==1))):
254 self.y -= self.speed
255
256# Initialization of signals with default values
257def initialize():
258 ts1 = TrafficSignal(0, defaultYellow, defaultGreen, defaultMinimum,
defaultMaximum)
259 signals.append(ts1)
260 ts2 = TrafficSignal(ts1.red+ts1.yellow+ts1.green, defaultYellow, defaultGreen,
defaultMinimum, defaultMaximum)
261 signals.append(ts2)
262 ts3 = TrafficSignal(defaultRed, defaultYellow, defaultGreen, defaultMinimum,
defaultMaximum)
263 signals.append(ts3)
264 ts4 = TrafficSignal(defaultRed, defaultYellow, defaultGreen, defaultMinimum,
defaultMaximum)
265 signals.append(ts4)
266 repeat()
267
268# Set time according to formula
269def setTime():
270 global noOfCars, noOfBikes, noOfBuses, noOfTrucks, noOfRickshaws, noOfLanes
271 global carTime, busTime, truckTime, rickshawTime, bikeTime
272 os.system("say detecting vehicles,
"+directionNumbers[(currentGreen+1)%noOfSignals])
273 noOfCars, noOfBuses, noOfTrucks, noOfRickshaws, noOfBikes = 0,0,0,0,0
274 for j in range(len(vehicles[directionNumbers[nextGreen]][0])):
275 vehicle = vehicles[directionNumbers[nextGreen]][0][j]
276 if(vehicle.crossed==0):
277 vclass = vehicle.vehicleClass
278 # print(vclass)
279 noOfBikes += 1
280 for i in range(1,3):
281 for j in range(len(vehicles[directionNumbers[nextGreen]][i])):
282 vehicle = vehicles[directionNumbers[nextGreen]][i][j]
283 if(vehicle.crossed==0):
284 vclass = vehicle.vehicleClass
285 # print(vclass)
286 if(vclass=='car'):
287 noOfCars += 1
288 elif(vclass=='bus'):
289 noOfBuses += 1
290 elif(vclass=='truck'):
291 noOfTrucks += 1
292 elif(vclass=='rickshaw'):
293 noOfRickshaws += 1

20
294 # print(noOfCars)
295 greenTime = math.ceil(((noOfCars*carTime) + (noOfRickshaws*rickshawTime) +
(noOfBuses*busTime) + (noOfTrucks*truckTime)+ (noOfBikes*bikeTime))/(noOfLanes+1))
296 print('Green Time: ',greenTime)
297 if(greenTime<defaultMinimum):
298 greenTime = defaultMinimum
299 elif(greenTime>defaultMaximum):
300 greenTime = defaultMaximum
301 # greenTime = random.randint(15,50)
302 signals[(currentGreen+1)%(noOfSignals)].green = greenTime
303
304def repeat():
305 global currentGreen, currentYellow, nextGreen
306 while(signals[currentGreen].green>0): # while the timer of current green signal
is not zero
307 printStatus()
308 updateValues()
309 if(signals[(currentGreen+1)%(noOfSignals)].red==detectionTime): # set time
of next green signal
310 thread = threading.Thread(name="detection",target=setTime, args=())
311 thread.daemon = True
312 thread.start()
313 # setTime()
314 time.sleep(1)
315 currentYellow = 1 # set yellow signal on
316 vehicleCountTexts[currentGreen] = "0"
317 # reset stop coordinates of lanes and vehicles
318 for i in range(0,3):
319 stops[directionNumbers[currentGreen]][i] =
defaultStop[directionNumbers[currentGreen]]
320 for vehicle in vehicles[directionNumbers[currentGreen]][i]:
321 vehicle.stop = defaultStop[directionNumbers[currentGreen]]
322 while(signals[currentGreen].yellow>0): # while the timer of current yellow
signal is not zero
323 printStatus()
324 updateValues()
325 time.sleep(1)
326 currentYellow = 0 # set yellow signal off
327
328 # reset all signal times of current signal to default times
329 signals[currentGreen].green = defaultGreen
330 signals[currentGreen].yellow = defaultYellow
331 signals[currentGreen].red = defaultRed
332
333 currentGreen = nextGreen # set next signal as green signal
334 nextGreen = (currentGreen+1)%noOfSignals # set next green signal

21
335 signals[nextGreen].red = signals[currentGreen].yellow+signals[currentGreen].green
# set the red time of next to next signal as (yellow time + green time) of next
signal
336 repeat()
337
338# Print the signal timers on cmd
339def printStatus():
340 for i in range(0, noOfSignals):
341 if(i==currentGreen):
342 if(currentYellow==0):
343 print(" GREEN TS",i+1,"-> r:",signals[i].red,"
y:",signals[i].yellow," g:",signals[i].green)
344 else:
345 print("YELLOW TS",i+1,"-> r:",signals[i].red,"
y:",signals[i].yellow," g:",signals[i].green)
346 else:
347 print(" RED TS",i+1,"-> r:",signals[i].red," y:",signals[i].yellow,"
g:",signals[i].green)
348 print()
349
350# Update values of the signal timers after every second
351def updateValues():
352 for i in range(0, noOfSignals):
353 if(i==currentGreen):
354 if(currentYellow==0):
355 signals[i].green-=1
356 signals[i].totalGreenTime+=1
357 else:
358 signals[i].yellow-=1
359 else:
360 signals[i].red-=1
361
362# Generating vehicles in the simulation
363def generateVehicles():
364 while(True):
365 vehicle_type = random.randint(0,4)
366 if(vehicle_type==4):
367 lane_number = 0
368 else:
369 lane_number = random.randint(0,1) + 1
370 will_turn = 0
371 if(lane_number==2):
372 temp = random.randint(0,4)
373 if(temp<=2):
374 will_turn = 1
375 elif(temp>2):
376 will_turn = 0
377 temp = random.randint(0,999)

22
378 direction_number = 0
379 a = [400,800,900,1000]
380 if(temp<a[0]):
381 direction_number = 0
382 elif(temp<a[1]):
383 direction_number = 1
384 elif(temp<a[2]):
385 direction_number = 2
386 elif(temp<a[3]):
387 direction_number = 3
388 Vehicle(lane_number, vehicleTypes[vehicle_type], direction_number,
directionNumbers[direction_number], will_turn)
389 time.sleep(0.75)
390
391def simulationTime():
392 global timeElapsed, simTime
393 while(True):
394 timeElapsed += 1
395 time.sleep(1)
396 if(timeElapsed==simTime):
397 totalVehicles = 0
398 print('Lane-wise Vehicle Counts')
399 for i in range(noOfSignals):
400 print('Lane',i+1,':',vehicles[directionNumbers[i]]['crossed'])
401 totalVehicles += vehicles[directionNumbers[i]]['crossed']
402 print('Total vehicles passed: ',totalVehicles)
403 print('Total time passed: ',timeElapsed)
404 print('No. of vehicles passed per unit time: ',
(float(totalVehicles)/float(timeElapsed)))
405 os._exit(1)
406
407
408class Main:
409 thread4 = threading.Thread(name="simulationTime",target=simulationTime, args=())
410 thread4.daemon = True
411 thread4.start()
412
413 thread2 = threading.Thread(name="initialization",target=initialize, args=()) #
initialization
414 thread2.daemon = True
415 thread2.start()
416
417 # Colours
418 black = (0, 0, 0)
419 white = (255, 255, 255)
420
421 # Screensize
422 screenWidth = 1400

23
423 screenHeight = 800
424 screenSize = (screenWidth, screenHeight)
425
426 # Setting background image i.e. image of intersection
427 background = pygame.image.load('images/intersection.jpg')
428
429 screen = pygame.display.set_mode(screenSize)
430 pygame.display.set_caption("SIMULATION")
431
432 # Loading signal images and font
433 redSignal = pygame.image.load('images/signals/red.png')
434 yellowSignal = pygame.image.load('images/signals/yellow.png')
435 greenSignal = pygame.image.load('images/signals/green.png')
436 font = pygame.font.Font(None, 30)
437
438 thread3 = threading.Thread(name="generateVehicles",target=generateVehicles,
args=()) # Generating vehicles
439 thread3.daemon = True
440 thread3.start()
441
442 while True:
443 for event in pygame.event.get():
444 if event.type == pygame.QUIT:
445 sys.exit()
446
447 screen.blit(background,(0,0)) # display background in simulation
448 for i in range(0,noOfSignals): # display signal and set timer according to
current status: green, yello, or red
449 if(i==currentGreen):
450 if(currentYellow==1):
451 if(signals[i].yellow==0):
452 signals[i].signalText = "STOP"
453 else:
454 signals[i].signalText = signals[i].yellow
455 screen.blit(yellowSignal, signalCoods[i])
456 else:
457 if(signals[i].green==0):
458 signals[i].signalText = "SLOW"
459 else:
460 signals[i].signalText = signals[i].green
461 screen.blit(greenSignal, signalCoods[i])
462 else:
463 if(signals[i].red<=10):
464 if(signals[i].red==0):
465 signals[i].signalText = "GO"
466 else:
467 signals[i].signalText = signals[i].red
468 else:

24
469 signals[i].signalText = "---"
470 screen.blit(redSignal, signalCoods[i])
471 signalTexts = ["","","",""]
472
473 # display signal timer and vehicle count
474 for i in range(0,noOfSignals):
475 signalTexts[i] = font.render(str(signals[i].signalText), True, white,
black)
476 screen.blit(signalTexts[i],signalTimerCoods[i])
477 displayText = vehicles[directionNumbers[i]]['crossed']
478 vehicleCountTexts[i] = font.render(str(displayText), True, black, white)
479 screen.blit(vehicleCountTexts[i],vehicleCountCoods[i])
480
481 timeElapsedText = font.render(("Time Elapsed: "+str(timeElapsed)), True,
black, white)
482 screen.blit(timeElapsedText,(1100,50))
483
484 # display the vehicles
485 for vehicle in simulation:
486 screen.blit(vehicle.currentImage, [vehicle.x, vehicle.y])
487 # vehicle.render(screen)
488 vehicle.move()
489 pygame.display.update()
490
491Main()

Experimental Results:

25
26
CHAPTER 5
CONCLUSION & FUTURE SCOPE
5.1 Conclusion

The literature on Traffic Management Systems (TMS) highlights the evolution of traffic control from
simple fixed-time systems to sophisticated adaptive and cloud-based solutions. Traditional systems, while
foundational, proved inadequate for handling the dynamic and complex nature of modern urban traffic.
Adaptive Traffic Control Systems (ATCS) like SCOOT and SCATS have demonstrated significant
improvements in managing traffic flow through real-time adjustments based on data from sensors and
cameras.

Intelligent Transportation Systems (ITS) further enhance traffic management by integrating advanced
technologies such as machine learning, data analytics, and connected vehicle technologies. These systems
offer comprehensive solutions for real-time traffic monitoring, analysis, and optimization, contributing to
safer and more efficient urban mobility. Cloud-based TMS add another layer of sophistication, providing
scalability, flexibility, and enhanced data processing capabilities, essential for handling the increasing
volume of traffic data in growing urban areas.

Despite these advancements, several challenges remain. Ensuring data quality and reliability is critical, as
inaccurate data can lead to suboptimal traffic management decisions. Integrating diverse technologies and
systems also poses significant challenges, requiring standardized interfaces and robust data management

27
practices. Additionally, scalability and cost constraints, particularly in rapidly urbanizing and developing
regions, limit the widespread adoption of advanced TMS solutions. Environmental factors and
unpredictable external events further complicate traffic management, necessitating systems that can
quickly adapt to changing conditions.

Looking ahead, future advancements in data analytics, machine learning, and the Internet of Things (IoT)
hold great promise for further revolutionizing traffic management. These technologies can enhance
predictive capabilities, optimize traffic flow, and improve decision-making processes. The integration of
autonomous and connected vehicle technologies is expected to transform traffic systems, enabling more
efficient and safer transportation. Moreover, blockchain technology can address data security and privacy
concerns, ensuring the integrity and confidentiality of traffic data.

In conclusion, while significant progress has been made in the field of traffic management, ongoing
research and development are essential to address existing challenges and leverage emerging
technologies. Advanced TMS solutions offer the potential to create more efficient, safe, and sustainable
urban transportation systems, ultimately improving the quality of life in cities around the world.

6.2 Future scope

The future scope of Traffic Management Systems (TMS) is vast and promising, with numerous
advancements on the horizon that can further enhance urban mobility, safety, and efficiency. As cities
continue to grow and traffic volumes increase, TMS will need to incorporate new technologies and
methodologies to meet the evolving demands of urban transportation.

One significant area of future development is the integration of artificial intelligence (AI) and machine
learning (ML). These technologies can improve predictive traffic models, enabling systems to anticipate
and mitigate congestion before it occurs. AI can also enhance adaptive traffic signal control, optimizing
signal timings based on real-time and historical data, and providing more efficient and responsive traffic
management.

The Internet of Things (IoT) is another critical component in the future of TMS. IoT devices, including
connected vehicles, smart traffic lights, and infrastructure sensors, will generate vast amounts of data that
can be used to monitor and manage traffic conditions more effectively. The real-time data provided by
IoT devices will enable more accurate and dynamic adjustments to traffic signals, better coordination of
traffic flows, and improved incident detection and response.

Autonomous and connected vehicle (CAV) technologies will also play a significant role in the future of
TMS. As the adoption of autonomous vehicles increases, traffic management systems will need to
accommodate these vehicles' unique characteristics and communication capabilities. CAVs can
communicate with each other and with traffic infrastructure, facilitating smoother traffic flow, reducing
accidents, and enhancing overall traffic efficiency.

Blockchain technology offers potential benefits for TMS in terms of data security and privacy. By
providing a decentralized and tamper-proof ledger, blockchain can ensure the integrity and confidentiality
of traffic data, which is crucial for maintaining public trust and ensuring the reliable operation of traffic
management systems.

28
Cloud computing will continue to be a vital component of TMS, offering the scalability and flexibility
needed to handle growing data volumes and computational demands. Cloud-based systems can support
large-scale data processing and storage, enabling more sophisticated analysis and real-time decision-
making.

Furthermore, advancements in communication technologies, such as 5G, will enhance the capabilities of
TMS by providing faster and more reliable data transmission. This will enable more responsive and
efficient traffic management, supporting real-time data exchange between vehicles, infrastructure, and
central traffic management centers.

Finally, the integration of sustainable practices into TMS will become increasingly important. Future
TMS will need to incorporate environmental considerations, such as reducing emissions and promoting
the use of public transportation and non-motorized modes of travel. This will help cities achieve their
sustainability goals and improve the quality of life for residents.

In summary, the future scope of Traffic Management Systems is broad and multifaceted, encompassing
advancements in AI, IoT, CAV technologies, blockchain, cloud computing, communication technologies,
and sustainability. These innovations will enable more efficient, safe, and sustainable urban transportation
systems, addressing the challenges of increasing urbanization and providing significant benefits to cities
and their inhabitants.

CHAPTER 6
REFERENCES
 Abdelgawad, H., et al. (2011). "Evaluating the impact of an adaptive traffic signal control system
in Toronto, Canada." Journal of Transportation Engineering.
 Barceló, J. (2010). Fundamentals of Traffic Simulation. Springer.
 Botta, A., et al. (2016). "Integration of cloud computing and internet of things: A survey." Future
Generation Computer Systems.
 Bretherton, R. D., et al. (2005). "SCOOT—The world's leading adaptive traffic control system."
Proceedings of the Institution of Civil Engineers - Transport.
 Brownstone, D., & Small, K. A. (2005). "Valuing time and reliability: Assessing the evidence
from road pricing demonstrations." Transportation Research Part A: Policy and Practice.
 Chen, X., et al. (2017). "A survey of traffic management in smart cities." IEEE Communications
Surveys & Tutorials.
 Diakaki, C., et al. (2002). "Integrated traffic-responsive urban corridor control strategy in the city
of Chania." Transportation Research Part C: Emerging Technologies.
 Fang, Y., et al. (2020). "Impact of adverse weather on traffic speed: a comparative study of urban
roads and highways." Transportation Research Part D: Transport and Environment.
 Gartner, N. H. (1983). "Development and evaluation of the traffic-responsive control algorithm."
Transportation Research Record.
 Gkartzonikas, C., & Gkritza, K. (2019). "What have we learned? A review of stated preference
and choice studies on autonomous vehicles." Transportation Research Part C: Emerging
Technologies.
 Hunt, P. B., et al. (1982). "The SCOOT on-line traffic signal optimization technique." Traffic
Engineering & Control.
 Krajzewicz, D., et al. (2012). "Recent development and applications of SUMO - Simulation of
Urban MObility." International Journal On Advances in Systems and Measurements.
 Kshetri, N. (2017). "Can blockchain strengthen the internet of things?" IT Professional.

29
 Li, Y., et al. (2020). "Internet of Things (IoT) in smart transportation: Applications and
challenges." IEEE Transactions on Intelligent Transportation Systems.
 Liu, J., et al. (2018). "Scalable cloud-based traffic management system for urban areas." Journal
of Cloud Computing.
 Lowrie, P. R. (1990). "SCATS: The Sydney Coordinated Adaptive Traffic System - Principles,
methodology, algorithms." Proceedings of the Institution of Civil Engineers - Transport.
 Mollah, M. B., et al. (2017). "Cloud computing and its applications in the world of networking."
International Journal of Computer Science and Information Technology Research.
 Muñoz, L., et al. (2015). "Smart city initiatives: The case of Barcelona." Journal of the
Knowledge Economy.
 PTV Group. (2019). VISSIM 2020 User Manual.
 Qian, X., et al. (2019). "Simulation-based optimization approach for connected and autonomous
vehicle deployment in Singapore." Transportation Research Record.
 Sims, A. G., & Dobinson, K. W. (1980). "The Sydney Coordinated Adaptive Traffic System
(SCATS) - A traffic responsive method for controlling urban traffic." Proceedings of the
Institution of Civil Engineers - Transport.
 Smith, B., et al. (2013). "Real-time traffic management using a cloud-based platform." IEEE
Transactions on Intelligent Transportation Systems.
 Stevanovic, A., et al. (2008). "Adaptive traffic control system deployment: Field test results and
findings." Transportation Research Record.
 Talebpour, A., & Mahmassani, H. S. (2016). "Influence of connected and autonomous vehicles on
traffic flow stability and throughput." Transportation Research Part C: Emerging Technologies.
 Tang, J., et al. (2019). "Machine learning for traffic flow prediction: A survey." IEEE
Transactions on Intelligent Transportation Systems.
 Webster, F. V. (1958). "Traffic signal settings." Road Research Technical Paper No. 39.

30
31

You might also like