How to manage traffic in today's world has
become a necessity, so that the traffic
lights in cities and on the streets are
considered to be the main tools of urban
traffic management.
Currently, the method of applying the
duration of green and red lights for each
route is applied according to the
pre-determined rules that can determine
the duration of stopping and moving for
cars and pedestrians.
Now in the new era and with the advancement of
technology and the emergence of a new generation
of technology called artificial intelligence,
it has given us the opportunity to use these
tools in any field we need and use them in various
issues.
In this project, we will examine how to use a type
of artificial intelligence that uses criteria such
as the number of cars that are added to the desired
point at the designated time, which is the place
where the traffic light is installed, and also the
length of the queue of cars that have already
arrived have existed at the desired point, they are
used to determine the time of traffic lights and
based on fuzzy rules.
As we know, fuzzy rules are actually more realistic,
so we use these rules a lot in our daily life. The
basis of using fuzzy rules is that it examines
existing conditions and data by assigning membership
values, and this makes conditions to be examined
based on probabilities, that is, the same practice
that we use in our daily life we are facing it.
In this project, we implement the project using the
available library for fuzzy rules and the powerful
Python language. At first, we consider the four main
factors in determining the time of the traffic
light, which are: the balance of both lanes, the
imbalance of both lanes, the balance of the first
lane, and the imbalance of the second lane, so that
both high traffic show for one route, the first
route is balanced and the second route is unbalanced
so that each shows high traffic for different
routes. Being balanced means that the difference
in the number of cars for two routes is less than 4
cars, otherwise it will be unbalanced, so we have
to examine this balance condition for both the car
entry rate and the car queue.
For fuzzy rules, membership values are defined
according to the images shown below.
Now, by implementing an artificial intelligence
system in such a way that it obtains the values of
the arrival rate and the queue length in a certain
period of time and gives it to our system, it
calculates the duration of the traffic light staying
on using the existing membership values and defined
calculations the most appropriate time will result.
After defining the membership values, it is time to
define the fuzzy rules, based on these rules, the
system is supposed to take the input values and
determine the time to control the traffic, some of
these rules are listed below.
After defining the rules and applying them to the
fuzzy system, it is time to give the inputs to the
system and see the output. Below is an example of
the output of the implemented fuzzy system, which
can be seen in the best possible way it determines
the time the traffic light stays on for each route,
which is the most optimal mode based on the given
inputs.
This project shows only one example of the uses of
artificial intelligence and fuzzy rules, which can
be very useful and used in everyday life. Therefore,
in today's world, it can be said that artificial
intelligence has the first word and learning how to
use this technology is an important and necessary
thing in today's era.
Thanks.