Modeling and Simulation of Adaptive Trafﬁc Control System for Multi-Intersection Management using Cellular Automaton and Queuing System

—During last years, urban trafﬁc has become one of the most studied research topics. This is mainly due to the enlargement of the cities and the growing number of vehicles traveling in this road network. One of the most sensitive problems is to verify if the intersections are congestion-free. Another related problem is the automatic reconﬁguration of the network without building new roads to alleviate congestions. These problems require an accurate model to determine the steady state of the trafﬁc. The present article proposes an adaptive trafﬁc light system based on the BCMP network queuing and cellular automata. The aim of this work is to predict the best red and green time span by combining three important factors: The queue length, the evacuation time and the capacity of the destination roads. This approach can maximize the number of vehicles passing intersection and at the same time can minimize the average waiting time of vehicles as a result reducing the congestion and keep the ﬂuency in intersections. To validate our results, we compared our model with a ﬁxed model to explain the strengths of our proposed algorithm.


I. INTRODUCTION
Traffic congestion is nowadays regarded as one of the biggest problems related to mobility in every country, mainly in big cities. This phenomenon causes many problems for people like lost time, fuel consuming and huge waste of energy. The inability to reduce traffic and the imbalance between the infrastructure and traffic demand are the main causes of the congestion. Therefore, the need to build new roads, bridges and tunnels are required, but it's necessary to combine with new technology in order to balance between the traffic demand and the existing infrastructure.
Many researches have been done in recent year in order to propose new technology to manage urban traffic smartly. The researchers concluded that if the intersections are occupied by vehicles, then traffic congestion occurs. And to solve this problem traffic light control system has been proposed in order to control the vehicles in the city, town and village. The most used traffic control systems are static, i.e., the time periods are given in advance as static results by calculating the delay time of the traffic lights using current situation with the help of sensors and cameras. But, in reality, the density in an intersection is dynamic due to the instability of the traffic conditions in different time like rush hours. Therefore, the fixed strategy cannot match the need of the actual traffic situation. Thus, the intelligent traffic light systems have become an essential need in order to regulate the traffic by adjusting the time span based on the number and speed of the vehicles existing at the intersection in real time. Those systems can maximize the number of vehicles passing the intersection and minimize the number of the blocked one as a result, can effectively minimize the average waiting time of vehicles.
The most famous and successful adaptive traffic light system in the world is SCOOT [1] in England and SCATS [2] in Australia. The main objective of SCOOT system is minimizing the sum of the average queues in the area [3] and SCATS tries to find the best phasing for current traffic situation using a fixed plan [4]. Furthermore, various methods have been applied in the optimization traffic light protocol such as Fuzzy logic control [5] and [6] that use the Fuzzy logic and image processing to vary the timing of the traffic lights controllers. In [7] authors presents different artificial neural network approaches for computer to predict the traffic network. And [8] the authors propose a new algorithm to manage traffic light at the intersection using Genetic Algorithm. Also, cellular automata models are the most of microscopic models have been developed in recent year due to the flexibility and simplicity of modeling. The Biham, Middleton and Levin [9] was the first CA model applied to the urban traffic light, it describes the different state of traffic and identifies the key factors affecting the phase transition [10]. A lot of extensions of this model have been developed wish means that the cellular automata is a good way to describe the urban traffic flow. For example in [11] authors used a cellular automaton to simulate road traffic in order to present a novel application of array DBMSs. Otherwise in [12] authors proposed a new cellular automata model under Kerner's framework that manage vehicles by considering the effect of forward-backward vehicles in the internet of vehicles. In addition, authors of [13] used cellular automata to generate a mixed traffic flow in order to analyze the behavior of manually driven and autonomous vehicles. Otherwise, to predict the traffic situation and model highway traffic researchers use queuing models in order to propose the best set of time based on the queue length of each road in the intersection as result optimizing the traffic flow and evaluating the system performance [14]. Most of methods developed in the recent period mainly focused on unsignalized intersections [15]. In [16] authors propose a review about queuing models of unsignalized intersections and in [17] authors presented an approach for both signalized and unsignalized intersections. The author in [18] presents an algorithm that identifies levels of congestion in traffic problems. The author in [19] propose a model for an urban road network dedicated to traffic intersection. And [20] represented an urban road intersection with the BCMP queuing network. Authors programmed a simulator to emulate the vehicle behavior at the intersection and they present a comparison with the analytical model and the proposed approach.
Most of the systems mentioned above focused only to optimize the average waiting time of vehicles in queues and it don't take into consideration the evacuation time of the crossroad. This later is an important parameter because if vehicles stay more time in the crossroad automatically the average waiting time of vehicles will increase and congestion will occur. And to solve this problem we need to guarantee the balance between the number of vehicles passing the intersection and the capacity of the destination roads.
The aim of this paper is to present a new adaptive traffic light system in which traffic light time changes in real time based on the queue length and the capacity of roads. To implement this model, the traffic roads have been designed with cellular automaton in order to study the vehicle behavior between intersections. And use the BCMP queuing system to model our network and calculate the performance measure such as the arrival rate, the average queues length and density of roads. The main objectives of our system are maximizing the number of passing vehicles, minimize the average waiting time in the network and ensure that all vehicles can leave the intersection in the least possible time.
The remaining of this paper is organized as follows: Section 2 presents the necessary scientific background about the BCMP queuing systems and the cellular automaton models. Section 3 presents our proposed approach. In Section 4 we will discuss the experimental results and its analysis, then in Section 5 the conclusion will be drawn.

A. BCMP Queuing System
BCMP is a queuing system that consists of a set of queuing centers or stations. Each service center has a scheduling discipline. Each client in the network has a class wish may influence the routing probabilities and the service time at the stations. The classes are labeled by 1, .... . . .., R and it can be partitioned into chains. The client enters the network from the outside according to a Poisson process with a give probability, waits in the queue for the service and it gets the next available center or exits the network. The BCMP network contains M stations and R client classes. Each client has a class and for each class a routing probabilities must be specified in order to describe the classes behavior throughout the network. A class can be open which means that clients of this class enters from the outside and eventually leave the network. Or closed which describes client that can never leave the network. Note that in this work only the open class has been studied. There are three sorts of service sectors in an open network. Input sector I i used by clients to enter the network, output sector (O i ) used by clients to exit the network, and internal sector S i used to move inside the network. Therefore, the routing probability is a float number R Si,Sj which describe the probability that a client can move from sector S i to S j . Table I presents an example of a routing probabilities values for a network composed by one input sector, one internal sector and one output sector. Note that the sector 0 describes the outsides of the networks. In BCMP network, queuing stations can be classified as one of the following: • Type 1: The queuing discipline is first in first out (FIFO) and distribution of service time is exponential and class independent.
• Type 2: The queuing discipline is processor sharing.
• Type 3: All the stations have infinite servers (IS) wish means clients never wait in queue.
• Type 4: The service discipline is last in first out (LIFO) with preemptive resume.
And the following variables are used to describe the open BCMP network parameters: • R: The number of traffic classes in the network, • K ir : The number of vehicles of the r th class at the i th sector.
• µ ir : The service rate of the i th sector of the r th class.
• R 0,js : The probability in an open network that a vehicle from outside the network enters to the j th sector of the s th class.
• R ir,0 : The probability in an open network that a vehicle of the r th class leaves the network after having been served at the i th station.
• λ 0,ir : The arrival rate from outside to the i th sector of the r th class.
• λ ir : The arrival rate of vehicle of the r th class at the i th sector.
The performance measures are described as following [20].
• ρ ir : The utilization of the i th sector by r th class clients.
• k ir : The average number of clients of r th class at the i th sector.
(IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 13, No. 5, 2022 • T ir : The average response time of r th class clients at the i th sector.
• W ir : The average waiting time of r th class client at the i th sector.
• Q ir : The average queue length of class r clients at the i th sector.
Note that i and j indicating sector numbers, while r indicates traffic class Most researchers have applied the BCMP network system to solve problems related to urban traffic. In [21] authors present a queuing theoretic framework based on BCMP for modeling autonomous mobility on demand systems within capacited road networks. The author in [22] approved using an open BCMP queuing network the uniqueness of solution to obtain an optimal static routing. In [23] authors proposed a simulation of parking using a network of service center capacity queues. in

B. Cellular Automaton
Cellular automatons were originally proposed by John Von Neumann [24]. It consists of a grid of cells. These cells are all equal in size and the lattice can be finite or infinite in number of cells. Also, its dimension can be 1 wish called a linear string of cells, 2 wishes describe a grid of cells or even higher dimension. Every cellular automaton should have three elements: • Cell's States: It's an integer represents the state of each cell.
• Cell's neighborhoods: To determine the evolution of the cell it should define neighborhoods for each cell. In the simplest case, for example, in a two-dimensional CA the four west, east, south and north adjacent cells are neighborhoods and their state can affect the state of cell in future steps.
• Transition function: It describes the rule followed so that the CA model evolves in time. This rule developed based on the neighborhoods state and model characteristic.
In recent years, most of the microscopic models developed by using the language of cellular automata (CA) [25]. Cremer and Ludwig [26] are the first whose proposed the first model of cellular automaton applied to the road traffic in 1986 and the Biham, Middleton and Levine model [9] is the first classical model applied to the urban traffic. This later describes the principal factors affecting phase transitions and identifies the different states of urban traffic flow [27]. A lot of researchers have proposed many extensions of the BML model. Fukui in 1996 [28] considered the average velocity in the BML and introduced the individual high-speed of vehicles by using the running speed of the traffic flow. Nagatani in 1995 [29] focused to reduce the numbers of gridlocks in the BML and improve the running status of the traffic by using the cloverleaf junction. Cuesta (1993) [30] and Nagatani (1995) [29] were the first to propose switch rules in the BML model. Ding et al., 2011 [31] have explored the mean field theory in the BML model and the authors of [32] were the first to propose a modified BML to predict the urban traffic jams in real time.

III. PROPOSAL APPROACH
In this work, the adopted network contains four connected intersections managed by a set of traffic lights pols. An intersection formed by two intersecting perpendicular streets; each street contains bidirectional traffic roads. For the sake of simplicity, the vehicles in this paper can't change their direction which means that if a vehicle enters the network from the north side automatically will leaves the network from the south side. For more details, see Fig. 1.
The traffic lights in a given axis have the green light simultaneously, but they switch to the red at different times because our algorithm calculates time of the red or green color individually for each direction and to simplify more our model it supposed that there was no yellow light. In order to describe our network, the following parameters will be used in this paper: • P i : Priority of the green light that equal 1 if in the road i has higher priority to leave the intersection.
• GT : Green light time.
• RT : Red light time.
• ET : Evacuation time of the intersection.
• RC: Maximal capacity of the road.
• F S: Free space in front of each road near the intersection.
• N : The number of vehicles existing in the road.
• S: Light state Boolean that equal 1 if the light is green and 0 otherwise.

A. Proposed Cellular Automaton
In order to describe the representation of the traffic between the intersections a one-dimensional cellular automaton has been implemented. This later represent the road as a line of cells, each car occupied only one cell and each cell can host only one vehicle. All cars move in the same direction and we supposed in this work that lane changing is not allowed. Their positions are updated synchronously, in successive iterations (discrete time steps). Note that the required time for a vehicle to move from cell to another is one second. The motion rules of our model are simply that a car moves if its destination cell is empty and all the vehicles behind can move by one cell. Figure 2 shows an illustration of our transition rules.
In this work the space between all intersections is equal which mean that the cell number N in each road in our network is fixed.
The road density is calculated by the following equation: Where C i present a Boolean variable that equal 1 if the cell is occupied and 0 otherwise.

B. Proposed BCMP System
In this work the proposed open BCMP queuing network model composed with 8 inputs sectors (I i ), 8 outputs servers (O i ) and every queue in each intersection has internal sectors wish means the proposed network have 16 internal sections (S (i,j) ). The arrival rates in this network following poisson distribution with parameter λ and the service rate following exponential distribution with parameter µ. The queues are type M /M /1 and the service policy is with first-come-first-served (FCFS).
The vehicle classes in this paper are defined as the flow of cars coming from the same input sector consequently 8 flow classes are identified and each class entering the network with parameter λ i .
For example, class 1 is defined by the vehicles entering network through input I 1 with parameter λ 1 and leaving it  Our BCMP model have 8 traffic classes, for each class, a routing probabilities must be specified based on the previous rules. Vehicles are moved between any two stations according to given routing probabilities. For example (see table II ) a class 1 traffic vehicle goes from the input to sector S (1,1) with probability R I1,S (1,1) = 1 then it either move to sector S (4,1) with the probability R S ( 1,1),S ( 4,1) = 1 and it leaves the intersection from sector O 6 with probability R S ( 4,1),O6 .

C. Proposed Algorithm
In this section the details of the adaptive control algorithm will be presented. The algorithm calculate the red/green time for each traffic signal using the following steps presented in algorithm 1.
The main objective of our model is to adapt the traffic signal duration with the intersection situation in order to minimize the average waiting of the vehicles in the network. The selection of the green time duration is based on the queue lane and the free space existing in front of the road (F S). FOR t=1 : T do 3: Take decision which axix has priority to have green time 4: calculate the green time using equation 10 5: generate the phase duration for all direction based on the decided green time 6: execute the phase 7:

END FOR 8: End procedure
The selection process is performed every cycle and work as below: First from the intersection structure the axe that has priority to have the green time is known, and based on the waiting lane and free space, the algorithm calculates the green time for each direction with the equation below: and Where i describes the intersection number and j the direction. Note that in every intersection j = 1 and j = 4 define the horizontal axe and j = 2 and j = 3 define the vertical one. After the program calculate the green time for each direction, then, calculate the cycle duration by adding the evacuation time of the intersection (ET i ) to the max of the two green times selected. For example, if the horizontal

IV. NUMERICAL SIMULATION
There are two simulated approaches, our model and the fixed model where the green and red time values are fixed. This simulation will lead to explain the differences between these two models and show the performance of the proposed adaptive system.
In this section the arrival and service rates parameters are presented.

A. Arrival Rates
This parameter defines the number of vehicles that arrive at a sector per time unit. As mentioned, we have 8 inputs which mean we have 8 arrival rate [λ 1 ,. . . . . . .,λ 8 ].
In Table III we present the different arrival rate with the situation that they occurred.

B. Service Rates
This rate defines the number of vehicles crossing a sector per second, it supposed that all the sectors in our network have www.ijacsa.thesai.org the same rate value µ = 1. Note that in this paper, it supposed that the number of cells between the intersections is equal to 40 and the evacuation time is equal to 3 seconds.

V. RESULTS AND DISCUSSION
To study the performance of our proposed model, we need to observe the behavior of the network density during 1 hour with different arrival rate values. For free flow state, the density was on average of 0.12 using our proposed model and 0.16 with the fixed model. See Fig. 4. fluent traffic and that impact directly the number of vehicles released from the network. From these figures, it can be observed that our proposed model allows vehicles to leave the network earlier than the fixed model Whereas after 1 hour our proposed model release 20% of vehicles with free flow state, 37% of vehicles with the medium flow state and 14% of vehicles with the congested flow state, more than the fixed model. Fig. 7 presents a special simulation because in this scenario the arrival rate λ = 1 which mean every second one vehicle enter from every input of the network. and it can be clearly seen that after 500 sec the fixed system was blocked. This phenomenon in reality needs a police agent to regulate the traffic, which explain the importance of the free space parameter in the prediction of the cycle duration. And in order to show the difference between our model and the others model that based only on the queue length, we add a comparison between our model and the same configuration, but without the free space parameter and it's clearly presented in Fig. 7 that our model keeps the fluency of the traffic and reduce the probability to have jammed state.
These results demonstrate that our model is more efficient than the fixed strategy in term of the density. This is because our algorithm makes the decision to turn the green light on when there are vehicles staying in the intersection and turn off when the queue is empty. Otherwise the fixed algorithm turns the green light based on a static strategy whatever the queue length. Also in term of the traffic fluency, the average throughput under free, medium and congested traffic situation is shown in Fig. 8. This later presents that our model keeps the traffic smoothly by minimizing the difference between the arrival throughput and the output flow in different traffic states. Note that when this difference is minimized means that the arrival vehicles can easily enter the network and leave it with a minimal traveling time as shown in the next paragraphs.
In the next figures the difference between our algorithm and the fixed algorithm in term of the average queue length is presented. The average queue length of the first intersection was extracted in order to study the effect of our proposed algorithm on different arrival rate.
In Fig. 9, the average queue length still between 0 and 1 with our proposal with an arrival rate λ = 0.4 otherwise with the fixed algorithm the average is between 1 and 4.5 which explain an important difference. Also, in congested flow state our model shows an important performance because the maximum of the average queue length was 1.5 where with the fixed strategy was 7.5. See Fig. 10. This can be explained by the fact that, when the queue length is considered to predict the green time, the average queue length decreases automatically.
From this, it can be seen that our algorithm guarantees to the vehicles in the intersection a low waiting time compared to the fixed algorithm. And in order to show more the performance of our system the average velocity in the network was studied in order to analyze the behaviors of the vehicles over time. Fig. 11 confirms that our model maximizes the average velocity in the network. But the most important fact deduced from this figure is that with the fixed algorithm the traffic  After that and to improve more our model we consider in the next results that the arrival rate from the network inputs are not equal. We supposed that we have 4 type of arrival rates λsouth for the vehicles coming from the south of the network, λnorth for the vehicles coming from the north, λeast for the vehicles coming from the east and λwest for the vehicles coming from the west. And we implemented 4 scenarios. Firstly, the λsouth and λnorth are equal to 0.4 which implies that we have horizontally a medium flow and vertically we have a congested flow i.e. λwest = λeast =0, 9. This scenario aims to compare the difference between our model and the fixed model in term of the average queue length for every direction.
Note that, the following parameters are defined: • AV : Average.
• N V : Number of Vehicles.
• AV N QL: Average Queue Length for North Vehicles.
• AV SQL: Average Queue Length for South Vehicles.
• AV EQL: Average Queue Length for East Vehicles.
• AV W QL: Average Queue Length for West Vehicles.
The Table IV shows a big difference between the two models, because our model turns off the green light when all the waiting vehicles in the south and north are served meaning that it give the priority to the others vehicle to be served earlier, while with the fixed model, the vehicles have to wait even if the other directions are empty. Which signifies the difference in term of the average velocity because with our model we can maximize the average velocity with 29% than the fixed model. The others scenarios supposed that vehicles come with a random arrival rate. As shown in the table, we notice that our model is better than the fixed model even if the situation. For example, in the fourth scenario our model maximizes the average velocity by 37% than the other model. Although sometimes there is not a big difference between the two models, for example, in the second scenario the difference between the average south queue length with our model and the fixed model is just 0.2. But our algorithm keeps the most interesting ones. And the reason theoretical of these results is due to the proposed new algorithm which is already explained above.

VI. DISCUSSION AND LIMITATION
Test results shows that the installed algorithm at the intersection ensures traffic flow in conditions of unsaturated flows. In addition, this demonstrates that our method can be successfully used for the construction of adaptive traffic control in conditions where traffic is related to time-varying traffic flows. In our optimization method, the traffic demands are well estimated based on the information from the adjacent intersections, which brings a good coordination among the intersections. It is worth to mention that our optimization method has a chance to obtain a better control scheme and to achieve an optimal solution for the network. However, the selection of the time based on the free space existing in the network affects the performance since using only the average queue length parameter might introduce longer unnecessary traffic delay to intersections just because the vehicles have not enough space in their destinations. Thus, in theoretical analyses, adapting the green time span using the combination between the queue length and the free space may reduce the delay time and keep the traffic fluency.

VII. CONCLUSION
In this paper, an intelligent system based on cellular automaton and BCMP queuing system has been proposed. The main advantage of this model is to avoid congestion at intersections due to the applied algorithm that calculate in every cycle time the free space on the roads and the waiting line in order to give the appropriate green time for every intersection taking into account the priority and intersection evacuation time. The results prove that our approach keeps the traffic fluency at the intersections and reduce the probability to attempt jammed situation than fixed method. Using BCMP performance measures helps us to manage the queues in our network, which guarantee an optimal average waiting time for vehicles.
Note that this approach can not only applied in transportation domain it can also apply in different situation like bank service, hospital out-patient service, etc.
In the future works, we will integrate other technologies like machine learning and multi-agent system to develop more our approach and guarantee a good vehicle experience in cities.