Intelligent Urban Traffic Flow Control: A Case Study on Fuzzy Logic Application

: This work uses concepts, tools, and methodologies associated to Operational Research and Artificial Intelligence to turn more efficient a system that controls traffic lights at a road crossing. Using Operational Research, through Linear Programming method, the intelligent traffic light operation is described as a mathematical formulation and constraints. That information is used for MacVicar-Whelam table elaboration that relates system pertinence rules through fuzzy logic techniques. It is pled, with the described development, to obtain of solid results for validation of the developed methodology, as well as its efficient control of intelligent traffic lights


Introduction
The increase of cities traffic generates a well-known problem for big cities, due to the growing number of vehicles, making the flow of vehicles increasingly slow and cluttered. To help alleviate this chaotic situation, it is used a traffic light system, which controls the flow of vehicles that move along roads of intense traffic, especially at intersections.
Several solutions are used to address this situation, such as synchronized traffic lights, remotely controlled or intelligent traffic lights, among other means. In case of intelligent traffic lights, various types are available such as: using sensors and simple rules for choosing configuration sets pre-programmed; using statistical data to re-configure, and using artificial intelligence techniques at various levels of complexity.
Traffic lights are installed at road intersections, usually with a three times sequence, pre-configured with temporal states that indicate to the driver the type of action to be taken, either "move on (go)", "attention, stop" or "stop". However, this system, in its most common version is effective only in situations where the flow of vehicles is small and with no large variations in time. In cases of heavy traffic and wide flow variation, it is necessary to install a greater control over the traffic configuration at intersections.
Major urban centers are increasingly adopting solutions of smart traffic lights to improve the flow of vehicles. This requires the development of techniques and studies that identify the best solutions at the lowest possible cost.
In the 90s, control systems that would adapt in real time to changing traffic flow were developed, thus allowing a better flow in major urban centers. According to [1]- [2], the city of Sao Paulo started using this solution in 1997, deploying real-time control in about 1,000 of its 4,600 intersections. Today there are 6,000 lights, and with that technology only 20% are able to be controlled in real time. The count of vehicles for these cases is made with inductive loops installed under the asphalt.
Several Brazilian municipalities, such as São Luís, Vitória, and Campo Grande, adopted the technology of inductive loops to monitor vehicular traffic. For example, in the capital city of the state of Mato Grosso do Sul, at the intersection of Rua Ceará with Rua Tapajós, inductive loops implanted in asphalt measures traffic before the crosswalk. When passing over the inductive loop installed at Rua Tapajós, the vehicle communicates to light that there is a demand for access Rua Ceará. When open, the light remains green for eight seconds until another car crosses the inductive loop, which generates more than four seconds "open signal" and so on, up to 28 seconds [3].
Also, the City of Santo André made the deployment of smart traffic lights in some downtown roads which are controlled by a computerized system [4]. The reconfiguration of times for each state of the traffic lights is be based on the number of vehicles passing through this road section.
In Curitiba, a system of intelligent traffic light was deployed at roads intersections holding the main roads with the lights on "green" state, to maximize flow and only initiates the "red" state when a vehicle stops at the intersection side-line, thus beginning the cycle that will interrupt the flow mainly towards enabling side-line vehicles pass [5].
Another example of using intelligent traffic lights has been proposed by [6], who submitted a proposal for intelligent traffic lights, based on Bayesian inference, which was devised for the city of São Caetano do Sul, testing a MCMC Gibbs Sampling algorithm, previously studied in [7].
The first implementation of a controller with fuzzy logic was published in scientific literature by [8]. A controller was implemented in a single intersection of two one-way roads. Results were validated by comparison with that obtained by conventional controllers, and with the average delay of vehicles such as performance criterion showing that a better performance.
Batur and Kasparian [9] presented a methodology for adapting the initial knowledge base with a view to changing operating conditions. Membership functions associated with the output process controller were adjusted to respond to past or future performance of the feedback control system. Bandyopadhyay and Patranabis [10] presented a PI (proportional-integral) algorithm for a self-tuning fuzzy inference engine. The ability to simulate the process of decision making of a human through fuzzy logic was studied by [11].
A realistic approach to fuzzy control of traffic signals to an urban road was described by [12]. It was presented with a simulation results for an intersection with traffic flows with 12 main directions. The proposed fuzzy controller controls switches between two, three and four states. Trabia et al. [13] presented the design and evaluation of a traffic signal controller with fuzzy logic for an isolated intersection. This controller was designed to meet the demand of real-time traffic.
Wey [14] presented a complete formulation of the problem formulation for optimizing network of existing traffic signaled. This formulation includes explicit constraints to model the movement of traffic along the roads between intersections at a time expanded network, as well as restrictions allowed to capture the movements of modern signal controllers.
A traffic junction signal controller based on fuzzy logic was presented by [15]. In order to design a more practical controller an environment was simulated to meet a better traffic situation than other controllers.
The main intention at [16] was to tie fuzzy reasoning to a logical framework of many values, similarity logic many-valued Lukasiewicz based fuzzy control algorithm was introduced and tested in three realistic traffic lights systems control.
To solve the problem of traffic congestion in modern cities, in [17] it has been proposed a framework for an expert system to control automatic and dynamic traffic lights combined with a simulation model, composed by six sub-models coded in Arena to help analyze the traffic problem. The problem of designing control strategies for traffic lights across the network to congested urban roads networks on a large scale was considered by [18]. In [19] the potential of traffic lights control based on fuzzy logic, transportation management system under the conditions of a single location to contain losses due to congestion was investigated.
In [20] a simulator system of traffic lights junction based on fuzzy logic to design and to propose a controller for intelligent traffic lights junction, and observe their performance was developed.
In [21] a Swarm Intelligence approach for finding success cycle programs for traffic lights, using a microscopic traffic simulator for solutions to their algorithm was proposed.
In [22] the concept of energy to deal with traffic lights for flow control of an over-saturated simple intersection was used.
The objective of this work is to present a fuzzy logic based methodology in order to obtain the best combinations of timing for a traffic light located at an intersection of heavy flow of vehicles, in the city of São José dos Campos, São Paulo State, Brazil, in order to construct an intelligent traffic light.
This work is organized in five sections. Section 1 is formed by introducing topic developed in this work, a brief literature review of the related topics, objectives/contribution of this work, and description of the sections, which are given in this paper. Section 2 presents the problem statement formed by general information on traffic lights rules and assumptions considered in this work. Section 3 presents the proposal for solution of the problem addressed.
Section 4 presents simulation of situations adopted to make it possible to see the proposed method acting into traffic flow analysis.
Section 5 presents conclusions about the proposed method.

Problem Statement
The traffic light should work according to the number of vehicles in each road, and should always give priority to the main road. The time that the traffic lights will be in each state (green, yellow, red) should be calculated to exceed the maximum and minimum limits stipulated by the project and have peak performance, i.e., it must allow the passage of more vehicles, while those on the secondary road should wait for a longer time. Assumptions to be considered in this project: 1. a crossing with one-way road, where there are two three stage traffic lights for each one; 2. each vehicle takes a second to pass through the intersection (stipulated time for simulation purposes); 3. the maximum block size is 20 cars for the main road and 10 cars for the secondary road; 4. the total time between each green state in main road is 120 s; 5. the minimum time of a green state on secondary road is 10 s; 6. the yellow state is always 5 s. These values vary by day and time, with the minimum established by the Municipal Transport Secretary at São José dos Campos, São Paulo State, Brazil.

Problem Solution
This work began with literature research regarding technologies associated to this work, highlighting the cases of successful application of intelligent systems to control urban traffic.
Particularly, the study of Operations Research (OR) was designed to obtain knowledge for preparing the problem formulation, including its constraints formalism, aiming, therefore, at the best description of the problem.
Based on the constraints obtained with the techniques of Operations Research and Linear Programming criteria, a fuzzy model to simulate the system behavior, applying these values to MATLAB© Fuzzy Toolbox was set up.

Preparation of the Objective Function and the Constraints to the Problem of Intelligent Traffic Lights
Based on Operational Research techniques [23]- [24], with emphasis on decision making, a methodology was developed to describe a representative formulation of the intelligent traffic lights behavior and constraints related to the problem solution, in order to develop an intelligent traffic lights model based on fuzzy logic [25] to be simulated with MATLAB©.

Objective Function
According to assumptions in the problem statement, an objective function presented in (1), for the intelligent traffic lights proposed problem was developed.
Where: B i -Estimation of number of vehicles on a block that should go through a traffic light i during one green cycle; T i -Necessary time for a vehicle to go through a crossing; n -Number of traffic lights.

Constraints Set
According to assumptions related in problem statement, the constraints set presented in (2)-(9), for the intelligent traffic lights problem proposed, were developed.

Membership Rules for the Proposed System
After consulting with professionals in the traffic control. the best representative set of time variation as a function of vehicle flow, which will serve as a condition of entry for analysis of the diffuse model represented in the form of MacVicar-Whelam table was adopted (Table 1).  It is known that average value at crossing is 60 vehicles for main road and 60 for secondary road. Based on this information, possible to describe the membership rules for the system to be simulated as follows: if Main Road ≥ 100 and Secondary Road    Times adopted here refer to an ordinary day for these roads and they were obtained during field observation.
It must be noted also that the maximum time cycle is directly related to the number of vehicles and can be changed at any time. Here, a 120 s was adopted the most critical case, according to the Municipality of São José dos Campos [26]. Figures 1 to 3 show fuzzy sets drafted to illustrate time relationship mentioned in items 3.1 and 3.2 and assumptions related in item 2, based on the traffic specialist from City of São José dos Campos' Transportation Secretary, adapted for fuzzy set theory [26]- [27].

Fuzzy Logic Evaluation
These diagrams present time distribution, as signaling, according to traffic control criteria for the place used as reference in this study, at the intersection between avenues Nelson D'Ávila and João Guilhermino, in the center of the city of São José dos Campos. Figure 2 shows conditions established for the vehicles number in these roads.
The number of vehicles on roads has its states described in Section 4, and in short, the minimum for the main road is 20 cars and the maximum is 100 cars; the minimum for the secondary road is 10 cars and the maximum is 90 cars. Figure 3 shows the membership diagram for the rules established for the intelligent traffic lights system with fuzzy logic application.

Simulation Results and Discussion
This work was developed in three stages. The first stage was the statement for intelligent traffic lights problem, detailing key parts of its system of monitoring and control of urban traffic.    The second stage, after the succinct definition of the intelligent traffic lights problem, was the adoption of an operational research methodology, linear programming, for the preparation of representative formulation of the proposed problem, and especially the relationship of constraints on its operation, needed to produce the fuzzy model to be used in the simulation with fuzzy logic.
The third stage is related to the use of computer program for the proposed solution using fuzzy logic simulation. After studying the constraints described by the linear programming methodology, the membership rules for the fuzzy model based on constraints investigated were developed. Afterwards, the MATLAB© software to carry out implementation of this model and tests of the proposed solution was used. This simulation and tests enabled the validation of objective function and constraints originally designed.
Based on Table 1, six membership rules described in Section 3.2 were chosen to be represented in this simulation, because it seemed to be sufficient to represent the methodology proposed. Figure 4 shows these rules listed into MATLAB©.   Figure 5 shows input and output variables representation, according to adopted criteria for membership functions, described in item "Membership Rules for the System Proposed". Figure 6 shows surface view for membership rules represented in Figures 4 and 5.
After all inputs, outputs and membership rules are set, with their respective membership degrees, the SIMULINK© from these data and runs the simulation was implemented. Figure 7 shows the configured system for the simulation of intelligent traffic lights. Figure 8 shows a basic configuration for a simulation system with fuzzy logic. The block constant implies the adoption of a fixed value for the vehicles flow on the main road. The block sine wave represents a flow that varied between 20 and 60 cars, according to their place, setting lower and upper limits. The block scope allows for a graphical visualization of the action of the fuzzy controller in the system. Figure 8 shows the simulation results performed in the diagram showed in Figure 7, where the yellow line represents the times for main road and the blue line represents the times for secondary road.      Mamdani's method [28]- [30] was chosen as standard fuzzy method with centroid defuzzyfication method and a range from 20 to 100 was established as vehicles number for main road and from 10 to 90 for secondary one. These values correspond to those established as assumptions for this simulation. Figure 14 shows output configuration for main road and for secondary one. The same methods from input were chosen for output with times range from 25 s to 105 s for main road and from 15 s to 90 s for secondary one.
The main advantage of the proposed method is to make it possible to develop a preview of flows based on previous information and/or to take decision based on real time information. Figures 15 and 16 show two possibilities with variation of vehicles number for main road ( Figure 15) and after for secondary road (Figure 16).

Conclusions
The results obtained in this work reached the objectives, given that the linear programming enabled the development of a concise and representative statement of the process, as well as described the details of the operation of intelligent traffic lights through its constraints, which allowed to produce membership rules to the fuzzy model. This work represents an initial step in proposals of development and implementation of intelligent traffic lights, involving, for example, the use of other artificial intelligence technologies, such as genetic algorithms or neural networks, and the use of sensing to count the number of vehicles, providing a way to monitor the flow of vehicles and adapting the system to the reality of the road interceptions in real time. Moreover, for generality purpose, the present methodology should be tested by application to more complex road intersections.