A proposal for modeling intersections in traffic systems by using adaptive fuzzy Petri nets

It can be observed that the number of vehicles, accidents and congestion increase proportionally with the development of a city. A vehicular traffic system behaves like a discrete event system, and due to variations that affect the level of congestion, modeling and controlling this system becomes a complex task. Petri Nets are one of the most powerful tools for modeling graphically and mathematically. Some systems are characterized by little information, inaccurate data and / or permanent changes with regard to the model of the system, which makes modeling and control difficult. This has led to modeling techniques that apply adaptation techniques and human knowledge representation through bio-inspired computing systems such as Neural Networks and Fuzzy Logic. These techniques will be harnessed in this work in terms of an approximated model for learning in a discrete concurrent system by using Fuzzy Petri Nets to represent knowledge through the application of inference and adaptive rules in a chaotic environment, like it can be found in a traffic system.


Introduction
Roads and traffic grow with the development of cities, as does the number of vehicles and accidents.In general terms, traffic congestion is a situation which occurs when the demand at one or more points of a road exceeds the maximum volume that can pass through that point.In order to get congestion it is necessary that the demand increases or that the maximum possible capacity of the location under observation decreases.These changes may occur over time or alongside of the route (Bull 2003).
In the field of simulation traffic control is one of the important areas of development, as models in this area make it possible to assess different variables that interfere with the traffic system, such as collisions or pollution, etc.This article develops and analyzes a model for reducing traffic congestion in a study area by using a model based on discrete events.Fuzzy Petri Nets Fuzzy Logic is a technique that allows the treatment of parameters and variables that store highly qualitative information, which is fuzzy, vague or incomplete, as stated in the theory of fuzzy sets (Zadeh, 1965).From the perspective of adaptation and learning of discrete systems there have been various trends that show the combination of Petri Nets (PNs) with fuzzy logic, which converged in FPN, "Fuzzy Petri Nets" or simply "Basic Fuzzy Petri Nets" (BFPN), as a new tool.
One of the first projects that were developed to solve the described problem started with test controllers that were entirely fuzzy and that were applied to traffic systems.As it was shown by Cai et al. (2008), this was how progress was achieved continuously with respect to the characterization of the distribution of these models in groups.Additionally, fuzzy controllers were progressing with the emergence of the fuzzy Takagi-Sugeno model, which was modified in order to apply it to intersections, linking this method to the schematic representation of Stochastic Petri Nets (Hennequin et al. 2001).This development represented a new outlook for FPN (Figure 1)., 1996).(Li y Lara-Rosano 2000).

Figure. 2. Adaptive fuzzy Petri net
Adaptive Fuzzy Petri Nets In order to achieve that real-time systems present information in a more reliable way, adapting to the system behavior, the integration with learning abilities from neural networks was proposed (Hagan et al. 1996).This concept stems from the creation of adaptive fuzzy Petri nets (AFPNs) (Figure 2), which are characterized by changing their weights and learning with each executed iteration.
The model of AFPN's for dynamic knowledge representation was developed in (Li & Lara-Rosano 2000) and its application is used to provide more specific attributes such as fuzzy cluster sets (Daneshfar et al. 2009).
This article presents an adaptive fuzzy system for the control of a traffic system that is based on two states of fuzzy clusters with multi-agent systems, which represent an interesting development in this research area, to provide solutions in real time and based on the principles of artificial and computational intelligence.In the area of artificial and computational intelligence there are several proposals and combinations with respect to PNs to provide flexibility, cooperation, hierarchy, among others, which are powerful tools that characterize this branch of computing.
For this propose a number of models and techniques were evaluated that have been applied to improve traffic systems.Here, a model will be proposed that is based on the principles of Petri Nets and the integration of expert knowledge through linguistic elements such as fuzzy sets and the adaptive capacity of neural networks.

Methodology For the proposed model
For the development of the model, the language of colored fuzzy Petri nets is used (CPN's), applying the CPN tools developed by Aarhus University.This system has 6 elements that are stored in a vector (P, T, C, I − , I + ,M 0 ) (Votano et al. 2004) where: 1. P = {p1, p2, . . ., pn} denotes a non-empty finite set of geographical locations.
2. T = {t1, t2, . . ., tm} denotes a non-empty finite set of transitions, P ∩ T = ∅, 3. C: Color function that assigns a non-empty finite set of colors to each location and each transition mode.
4. I − and I + denote forward and backward incidence functions that are defined by P × T, such that: Where: Flow of vehicles on the road.
v maxi : Maximum flow on the road.
m i (t): Amount of vehicles entering the road at time t.α i : Factor that limits triggering the Petri Net according to the physical conditions of the road.
The entrance of vehicles to the road refers to the transition that is activated by the "GREEN" location, which characterizes the road that shows this state.In this transition the activity of dividing the most congested road is carried out in order to prioritize it.That is how this road will receive the "GREEN" state.After selecting the road which is most congested as shown in Figure 4, it is necessary to determine, if it is below the calculated percentage that represents the maximum capacity of the road; the latter value depends on the geometrical parameters of the road (Garber & Hoel 2009).According to the model, the road will be selected as an individual with properties which are represented by rules that will be assigned through an expert user.These rules are denoted by fuzzy sets that are defined through the occupancy rate of the road (shown in Figure 5) and the elapsed time the road had to wait in the state of "red light".This data represent the inputs which in turn represent the antecedent or previous traffic flow of the rules, while the necessary time interval in "Green" for the next road represents the consequent or next traffic flow of these rules.Thus, the associated rules will be of the type Mamdani (Cao & Chen 2010): The linguistic variables x i , i = 1,2, … q, represent the previous level of occupation and waiting time defined by the rules, while the variable y represents the consequent.Subsequently it can be proceeded to determine the generalized membership function for the Gauss distribution: Where: x : Input variable.The Adaptive Fuzzy Petri net is created from the membership factors with respect to the fuzzy sets of the inputs (x, y) and outputs (y), according to equation (2) mentioned above; while equation ( 4) generates the normalized weights that are multiplied by the area, equation ( 5), under the curve of the Gaussian function for each of the linguistic values of the inputs, as shown in the Figure 6.Where the defuzzyfication is achieved by using equation ( 3) and applying the centroid method:

., n
Where: To update the weights and importance of each road, the Gaussian activation function is selected for this work and for each value of the fuzzy  number, because the generalized delta rule, equation ( 6), is used for the learning process in this model: Where: Ġ is the derivative of the piecewise defined function of the Gaussian set.This update varies according to the information which will be entered by the user in a linguistic way, thus generating a network that represents the knowledge through 25 rules (Figure 7), and which adapts to a change in the number of vehicles that are circulating.This step delivers the output value in terms of the estimated duration of "GREEN" for a particular intersection.

Results and discussion
With the proposed model at hand the aim is to analyze the behavior of the next road after the training of the model terminates and according to the characteristics given in the the data that are used for calculating systematically the handling of traffic lights according to the Highway Capacity Manual (HCM), (Garber & Hoel 2009).At the same time the simulation for the adaptive fuzzy Petri net is performed.
Due to the fact that each road behaves like an individual, with a tendency towards its reference point (set point), based on the learning of the inference rules and the adaptation to the weights (road importance) of the network, the system acts as an optimizer for the entire intersection.Via the training it is also possible to obtain the error measurement for the training process, equation ( 7).
Here, 32 iterations, those have to be executed in order to learn this rule represent the optimal number of iterations.The results show the configuration for a road, and the training of it respectively, where the network takes the arrival of the vehicles as data to update the weights for the next instant of time.
The comparison of the road at the first instant of time, see the first image of Figure 8, shows a descending behavior of the vehicles in the output m2, which remains constant in terms of the accumulation of 15 vehicles during the green time, which comprises the first 50 seconds.This time remains fixed (23.6 s) regardless of the traffic flow on the other roads, that could take less time in staying "green", but must complete their fixed cycle time.This causes that the traffic light take more time being "red" and not being prioritized, which leads to an accumulation on the left and right road when the green traffic light is activated.On the other hand, it can be observed in the second image of Figure 8 that variations occur with the adaptation: in the first instance of 7s, starting from the 50 seconds mark; then from second 89 a variation of 12 seconds, then 8 seconds for the third phase in green and then 13 seconds.This leads to 3 remaining vehicles on the road as the final value, compared to approximately 6 remaining vehicles determined through HCM.

Conclusions
The proposed model allows the optimization of the training for the vehicular traffic model with respect to the traffic flow at an intersection, which is determined through the rules that are delivered by the user, taking into account that it is possible to vary this knowledge without affecting the model, due to its ability to adapt and learn.Thus, the proposed model allowed the adaptation of the model in real-time, based on the vehicular traffic.
It is noteworthy that the fit of the model depends on the right selection of parameters with respect to the linguistic variables that are entered by the expert user to generate the rules, so that the network converges to the optimum faster and in real-time, if the error is adjusted previously.
Although adjusting these parameters is significant for the model, it can be noted, that if a learning factor which responds to the needs of the problem is selected, the network will converge likewise.
In terms of future work, the suggestion is to develop a data acquisition system that delivers the data in real-time with respect to the utilization of the roads under observation and based on the identification of patterns in the images.This would help to adjust the parameters of linguistic values with respect to the Gaussian curves and would generate real data for the proposed model.
In addition to this and looking for an optimization of the learning factor of the network, the inclusion of an adaptive algorithm seems to be promising in order to make this value "self-adjusting".

Figure 1 .
Figure 1.Trigger of the Petri Net depending on the membership factor (Eversheim y Hack, 1996).

5 .
M 0 denotes a function that is defined on P, this describes the initial mark, such that M 0 (p) ∈ C(p) MS .As shown in Figure 3, the entrance of vehicles is described through a Poisson distribution (Chrif Tolba et al. 2003) via the location "ARRIVAL OF VEHICLES", which continues with the entrance on road m1, that is represented by the traffic flow equation (1) as detailed in (C.Tolba et al. 2005):

Figure. 3 .
Figure. 3. Proposed adaptive fuzzy Petri Net model.C i+1 : Capacity for vehicles on the road.m i+1 (t): Number of vehicles on the road that exit at time t.

Figure 6 .
Figure 6.Neural network for the adaption of the next cycle time in Green.

Figure. 8 .
Figure. 8. Comparison of traffic lights calculated by HCM vs Adaptive Fuzzy Petri Nets.

Table 1 .
Road data for the simulation.