Real-Time Adaptive Traffic Signals Using Rate-Monotonic Scheduling

The studies and real situations shown that the traffic congestion is one of nowadays highest problems. This problem was solved in the past using roundabouts and traffic signals. Taking in account the number of cars that is increasing continuously, we can see that past approaches using traffic lights with fixed-time controller for traffic signals timing is obsolete. The present and the future is the using of Intelligent Transportation Systems. Traffic lights systems should be aware about realtime traffic parameters and should adapt accordingly to them. The purpose of this paper is to present a new approach to control traffic signals using rate-monotonic scheduling. Obtained results will be compared with the results obtained by using others real-time scheduling algorithms.


Introduction
Transportation seems to be one of nowadays highest problems. If we take in account the data about vehicle production between 1999 and 2017 we can see a trend towards doubling the number of vehicles production every 15 years [1]. This increasing is also associated to population increasing from the mobility and goods transportation points of view.
The big number of cars leads to traffic congestion problems in middle and biggest cities around the world. We can mention a negative impact on environment and life quality due to CO 2 emissions. Also, road accidents are mentioned in top 10 causes of death worldwide. New solutions should be developed in order to reduce traffic congestion and its consequences.
Intelligent Transportation Systems (ITS) is the term used to define solutions that implies Internet of Things (IoT) technologies to manage the real-time movement of vehicles on a road network. The starting point of ITS is considered the year 1914, when was developed first three-colored traffic signal [3]. The trend is to develop autonomous-driven cars and traffic signals algorithms that are capable to adapt to real-time traffic situations.
The algorithms that can adapt by their own to real-time situations are the base of adaptive control concept definition. An adaptive control system has the ability to automatically adapt the driving strategy to the variation of the process model, to its structural variation, and to the variation of the exogenous signals that cause changes in the process model, ensuring the invariance of the performance for adjustment system [4].
In this paper, a description of traffic lights control systems is presented. We can see a short comparison between different approaches taken in order to control the traffic lights phases and timing. Section III will provide a model for traffic signal controller starting from the approach presented in [5].
In Section IV will be proposed an algorithm based on rate-monotonic scheduling for real-time adaptive control of traffic signals. Results will be analyzed in order to highlight the performance of the algorithm proposed in this paper.

Traffic lights control systems
Traffic congestion can be reduced by using appropriate algorithms for traffic lights management. One type of traffic lights control consists in using fixed-time to establish the phase sequence for the traffic lights from an intersection and the time for traffic signals colors. The other category of traffic lights control systems are adaptive control algorithms. These are considered part of ITS. Further we can find information about these concepts and some relevant previous work.

Fixed-time control systems
Fixed-time control systems are considered the simplest way to manage the traffic flow in intersections. In this case, for each traffic signal are predetermined the phases and timing based on statistics [2]. The intersection is studied before and the decision for green-time is based on traffic load from different days and hours. The parameters that are taken in account to establish the timing are the arrival rates of vehicles and the queue lengths.
A solution for modelling a fixed-time controller is given by relation (1). Arrival rate was computed using an exponential distribution and a YellowTime was taken in consideration for the switch time between red and green traffic signals [6].

4
CycleLength The big disadvantage of these control systems is that we cannot ensure that the traffic pattern shown by studies will be respected. Each modification on the number of cars or special situations that are occurring in traffic, such as injuries or roadworks, can lead to traffic jams.

Adaptive control systems
The fixed-time approach cannot be considered a solution for present and future. Traffic lights control systems should be aware of real-time traffic situations and is desirable to adapt to them.
In Fig.1 is presented an architecture for a traffic lights adaptive control system. It is needed to have special sensors for traffic monitoring, such as inductive loops, video cameras, radar systems, placed on the road network. These sensors will retrieve real-time data from traffic and will send them to a Signal Processing Unit (SPC). SPC will process the data to obtain the arrival rate of vehicles and the queue length. This data will be sent to an Adaptive Traffic Controller (ATC) whereas it is capable to compute optimal signal time and optimal phase sequence for the intersection, via internal algorithms. In the last step, traffic lights phase sequence and timing will be updated with the new values obtained from ATC. The main interest in adaptive control systems for traffic lights is the development of adaptive algorithms. Researchers developed this kind of algorithms based on fuzzy logic, parameters estimations or genetic algorithms. Further will be presented some relevant work of researchers in this domain.
A good approach to optimize the timing parameters for traffic signals was given in [5]. A comparison between fixed-time controllers and adaptive controllers was done. Each traffic light from an intersection is considered as a task and has a priority assigned. One adaptive algorithm was based on Earliest Deadline First with Always Ready Tasks (EDF-ART) scheduling. This algorithm can reduce the traffic congestion by giving priority, on traffic lights sequence phases, to the road lanes that have associated reduced time for green signal. Another algorithm that was studied was based on Least Execution-Time To Slack Ratio (LETTSR). The results shown that LETTSR was better than EDF-ART and fixedtime algorithms. Using LETTSR, the highest priority is given to the tasks more stressed in time.
The timing and phase sequence can be updated using a predictive algorithm. In [6], using the real-time data, the future evolution of queue lengths is computed. To calculate the optimal values for green-intervals and cycle lengths, are taken in account a maximum and a minimum queue length based on previous traffic pattern.
Another good approach is the using of the Radio Frequency Identification (RFID) controller and tags. Each vehicle can have installed a RFID tag used for sending the information from vehicles to RFID controller. The RFID controller can also send information about traffic to drivers. This system is designed in order to update the traffic signals based only on the queue length and on a maximum time associated to green and red signals [7]. This seems to be not a very good solution because, as we seen before, are also other parameters that can influence the traffic and should be taken in account.
An interesting solution to optimize the traffic lights management is given in [8]. The solution is inspired from artificial intelligence evolutionary algorithms. The Particle Swarm Optimization (PSO) algorithm for traffic signal control starts with the swarm initialization. Each vehicle is considered a particle in the swarm. The mentioned initialization refers to both the position of the particles and their velocity. Particle generation is random, and then the leader particle is established. Each particle then "flies" for a maximum number of predetermined iterations, updating the speed and position of each particle. Also, the best position of each particle is updated, because at the end of each iteration it is possible to determine the new particle leader.
Genetic algorithms were studied by a big number of researchers in last years. One implementation of a genetic algorithm based on JGAP (Java Genetic Algorithms Package) library was proposed in [9]. It is considered that all vehicles have navigation systems and there is a real-time connection between them and a traffic management center which can take the decision for changing the timing for traffic signals. The fitness function will evaluate the randomly created population and will compute the best solution based on lowest average delay.

Traffic signal controller modelling
In Fig.2 is presented a discrete event simulation model for SPC computation that has as starting point the simulation model from [5]. Model was developed in MATLAB R2012a version using Simulink with Simevents library.

Fig. 2. Simulation model of SPC.
Data obtained from SPC, that consists in intergeneration time and the average of queue length, will be sent to ATC. In ATC will be calculated the optimal time for green interval and will be used to calculate the new phase sequence via RM algorithm.

Rate-monotonic scheduling algorithm
Rate-Monotonic (RM) algorithm assigns the priorities to tasks based on their periods. The higher priority will be assigned to the task with the shortest period [10].
The algorithm is assuming that each task deadline i D coincides with the end of period  (2) is respected [10] [11].
If we look to (2), we can say that the utilization bound is dependent by computation time i C , release period i T and the number of tasks n .
The situation of number of processes that is tending towards infinity is defined by (3)  In the first step was analyzed the behavior of traffic signals taking in account the assumption that the event of vehicles arrival in intersection is randomly. The random generation of vehicles arrival was done in different situations by using an exponential function. The system was studied in three different situations. The value that was passed as parameter to Event-Based Random Number block was the inter-arrival time. The used inter-arrival time and the mean time associated to vehicle generation are shown in Table 1. After running the simulation, the behavior of queue lengths and optimal greeninterval were studied. In Fig. 3, we can see the results obtained by using data presented in Table I. We can observe that queue length has a big impact on the values that should be used for traffic signal timing. The second step, after obtaining the optimal values for green-interval is to optimize the phase sequence of those four traffic lights that exists in an intersection.
To adapt the traffic problem to RM traffic terms, we will make some correspondences: a traffic light will be considered a task, the time needed by a traffic light to repeat its signal flow will be considered the release period and the green-interval will be considered the computation time. We assume that each task (TL n , 1, 4 n  ) will be followed by a yellow time task (Y) of 3 seconds.
The release periods and execution time for each traffic light from an intersection are presented in Table 2.
Phase sequence for traffic lights is presented in Fig. 4.

Conclusion
In this paper were presented some relevant previous works about traffic lights management. Using those algorithms, the researchers shown how important is to use adaptive controllers instead of fixed-time controllers. Traffic light systems can react in realtime and can change the green-interval and phase sequence.
Based on a random generation for vehicles arrival in the intersection, a model was developed and optimal time for green-interval was obtained. Also, was shown the impact of queue lengths on optimal green-interval computation.
In the last part of this research, rate-monotonic scheduling algorithm was used to optimize the phase sequence of traffic lights in the intersection. We can see that based on green-interval, considered as computation time (to make the corresponding with the algorithm), the optimal phase sequence is obtained. Even if EDF algorithm is considered optimal, RM is more widely supported and more predictable. In comparison with EDF, RM can face the scheduling anomaly characterized by increasing overall execution time when the processor tries to speed up a task.
Rate-monotonic scheduling and other kinds of algorithms, that implies parameter estimation, fuzzy-logic or genetic algorithms can be used to increase the quality of transportation systems by reducing the traffic congestion.