Design Methodology of a Fuzzy Control System in PTV VISSIM

Fuzzy logic has been a popular tool for addressing advanced control tasks lately. This is true even in transportation, where it has been used for tasks such as ramp metering, control of traffic lights, as well as, for example, within highway management. Before application on a real street, however, such a control algorithm has to be evaluated and tested. In recent years, a so called microsimulation approach has been accepted as a useful tool for such tasks. In this paper, we demonstrate that PTV VISSIM can also be used for the evaluation of advanced control algorithms, even without the use of API. In this way, even without a knowledge of classic programming languages such as C ++ or Java, any fuzzy control algorithm can be implemented directly in the microsimulation tool and its effect on traffic directly evaluated. The ability to do this can be an important decision criterion when selecting a microsimulation tool, as was the case for example in the early stages in project SIRID (TA CR ALFA 2012 Technology Agency of the Czech Republic). The presented approach within this paper is demonstrated on a real world problem of a single intersection control.


INTRODUCTION
1.1 Microsimulation models to evaluate traffic control strategies Microsimulation models can measure different parameters of interest (such as delay time, travel time, average speed and others) on the basis of individual vehicles.Often, the decision to use one particular model is based on the experience of the development team and availability of a particular tool in the given organisation.In this paper, we selected the PTV VISSIM (PTV, 2011) software to help us in the project because of its usage at the Faculty of Transportation Sciences (Czech Technical University).For traffic control system design and development, the VAP language (Vehicle Actuated Programming) was used.Vehicle Actuated Programming VAP (PTV, 2012) is a simple programming language embedded as an add-on module to VISSIM.With the VAP you can create a phase or stage based and traffic actuated signal controls.The general programming elements in VAP are similar to those of common programming languages such as "If-then-else-end" used for a conditional statement and ":=" used for an assignment of values to variables.In order to make programming easier, PTV implemented a graphical user interface to design and edit VAPbased control directly and in a user friendly way.This interface is called Visualisation VAP (VisVAP) (PTV, 2006) and can be used, for example, for intersection control design, speed harmonisation, ramp metering and others.Using the VisVAP provides many advantages for the development of control system: intuitive and easy creation of control strategies using flowcharts, without deep programming knowledge, and the possibility of rapid changes of proposed control strategy for example for optimizing the control algorithm.Control strategy can be designed for any traffic system.Knowledge of the GUI ViVAP, bases of algorithms and the creation of flow charts is a sufficient condition for using the software VISVAP which is met by most of the experts in transportation planning.In this paper, the authors guide through the entire process of creating a fuzzy control system for a single intersection (even though the approach is the same for other applications) and implementing it using VisVAP.The results of a case study demonstrating its results are also included.

Fuzzy logic
A fuzzy set is a set without crisp boundaries.The transition between "to belong to a set" and "not to belong to a set" is gradual.Mathematically, we can define a fuzzy set A in X as a set of ordered pairs: is called the membership function (MF) for the fuzzy set A. The MF maps each element of X to a membership value between 0 and 1.After fuzzy logic is introduced, the control algorithm can be expressed using simple rules and human language.This additionally improves robustness of the control algorithms.For a better overview of fuzzy logic and its advantages please refer to (Babuška, 1998).It has to be noted that fuzzy logic was already introduced for traffic control in the 1970s (Pappis & Mamdami, 1977).

THE CASE STUDY
In order to demonstrate the approach, a fuzzy model, also known as the fuzzy inference system (FIS) is used on a real 4-leg intersection located in a town called Chrudim (Czech Republic).Nowadays the intersection uses a fixed-time control with two phases and an overall cycle time of 46s.The traffic volumes and origin-destination traffic data were collected as part of a traffic census in June 2011 within the project (Kocourek et al., 2011).In this paper, an alternative control algorithm will be proposed and compared to the existing one.On this intersection it was observed that there is an average total of 15.73 [sec/vehicle], average standstill 6.68 [sec/vehicle] and an average number of stops 0.70 [stop/vehicle].Our objective is clearly to improve these values.The results are provided in the final chapter of this paper.

FUZZY INFERENCE SYSTEM (FIS)
This section describes the design of a fuzzy control system, also called -fuzzy inference system (FIS) for a level intersection.An overview of a fuzzy signal control system within the scope of intersection control systems is illustrated in Figure 1.The names of input and output variables are denoted here, but described in the following parts of this paper.In the upper part of the picture a micro-simulation model in VISSIM application is depicted.The bottom part depicts the signal control system.The Signal controller needs vehicular detectors to provide accurate information of the prevailing traffic conditions in real-time.This information (VPT, VAG) is used as input data for the Fuzzy control system.The process of signal control calculates (gives) an output variable (GTD) which is transmitted to the signal heads.

Fuzzy knowledge base
The rule base together with the data base containing the different inference mechanisms is commonly known as the fuzzy knowledge base.The information on fuzzy sets of all variables used in the system is found in the database.The rule base contains all rules of the fuzzy inference system.The knowledge base and measured values of independent variables are used for an approximate deduction.An output fuzzy set is a result of such a deduction.The task of the further depicted inference mechanism is the evaluation of all rules and the subsequent merging of the results into one fuzzy set.We have set a twodimensional functional dependence of linguistic variables VPT, VAG.That means the interference rules make up pairs which belong to the set A × B. The set A × B is determined by a Cartesian product in our example.
For the number of rules, P, applies that P = m × n, where n and m denote the number of fuzzy set terms for each variable.This equation implies that the number of fuzzy rules increases significantly with the number of fuzzy set terms as well as number of input variables.In our case, since we have two variables, each of them with three membership functions, there are overall 9 fuzzy rules.Each fuzzy rule consists of two parts; an antecedent (between the IF and THEN) and a consequent (following THEN).The fuzzy rules are provided in the following table, where one lane corresponds to one fuzzy rule.Centre of gravity The crisp output value (i.e. the control signal) is determined as the coordinate of the centre of gravity (Jura, 2003), and computed according to equation (3). (3)

IMPLEMENTING CONTROL SYSTEMS USING VISVAP
VisVAP is a Graphical User Interface which broadens the possibilities of VAP language use for design of traffic control systems.VisVAP application can be defined as "a tool" for a comfortable design and editing of a program for traffic control system.Any VisVAP flow chart of the fuzzy control system consists of the following few basis elements (PTV, 2006).Please note that we are not providing all of the available elements, but only those needed for the design of a fuzzy control system.
Terminus Defines the start and the end of the program logic.

Statement
Used for commands and assignments Condition Used for logical conditions.

Fuzzy control algorithm in VisVAP
In this section, we focus on the implementation of a FIS using VisVAP.It has the following major steps.First the input and output membership functions must be parameterised in VisVAP and then we will proceed to the description of the fuzzy strategy of control in the VisVAP application.
Because of the complexity and length of the algorithm, the procedure is presented for one rule of Table 1 only.

Input and output membership functions and their parameterization using VisVAP
At first, crisp values must be transformed into linguistic terms (fuzzy sets), also called fuzzification.This is one of the most important steps in our approach and is described in this section in great detail.The proposed system uses triangular and trapezoidal types of membership functions.This decision was based on the computational efficiency of the proposed shapes and an easier parameterization.The proposed approach can however deal with any shape of the membership function (for example Gaussian), only since the software VisVAP cannot deal with exponential or logarithmic mathematical functions directly, such shapes must be approximated in terms of equivalent polynomial forms (Koukol, 2013).The following Figure 3 demonstrates parameterisation of a trapezoidal membership function.All parameters , ,  and , that are referred to in the flow chart and in expressions must be defined in the parameters table (VisVAP).The following flow chart (Figure 3) is an excerpt from VisVAP, demonstrating the corresponding implementation within VAP of calculating the membership function for the trapezoidal function.We used only two elements, the Condition and the Statement.The variable VPT denotes the volume of the vehicles.

Fuzzification, inference engine and defuzzification in VisVAP
In this section, the steps used in the FIS are described (Jura, 2003).As an example, we quote just the first rule line from Table 1.The important steps for designing (identification) of fuzzy systems are described in this Chapter.The following steps aim to focus on the particular issues described above and provide a description on how to implement them using VisVAP.Please note that their meaning is provided above.An example of implementing these steps is provided Figure 4 a) -e).
Computing a degree of membership First, the degree of membership is calculated for input value VPT.Given the inputs (crisp values) we obtain their membership values.This process is called 'input fuzzification' Figure 2 a).In the next step, the degree of membership is calculated for the input value VAG Figure 2 b).

Implement the rule evaluation and the rule consequent
After that the weight for a rule antecedent is computed.The minimum of all rules' degree of membership is applied in our model.The implementation in VisVAP is demonstrated in Figure 2 c).The resulting value is considered to be a weight of the rule (also called firing strength) and is applied to the consequent membership function MF_GTD_MAIN Figure 2 c).

Implement the defuzzification
The process of transforming a fuzzy set into a specific numeric value (GTD_MAIN) is called defuzzication, where the membership function of the output set is determined (given) by the union of cut-off membership functions (applies for Mamdani's type of FIS).Integration of the main and secondary communication of the fuzzy engine into the control program core is the final step.Basically it is nothing more than a basic system which can be expanded or easily modified.Furthermore, it is possible to apply various methods of fuzzification and defuzzication with discrete expression.

RESULTS OF CASE STUDY
The approach introduced in this paper has been proved in the model of an intersection described above.The model of a given 4-way intersection with traffic lights was calibrated according to the characteristics: volume, traffic flow composition, vehicle direction, speed of vehicles (curve, section) and time gaps.To determinate the quality of SSZ control, a 200m measured section was created for each traffic line in a microsimulation model.The beginning of the observed section was placed about 190m in front of the stop line and the end was situated on the outbound (exit) arm of the intersection.The data was collected in six different measurements for two different traffic control system (average value was calculated): a fixed time control (FT) and a control with fuzzy inferential system (FIS).The measurement took place from 6AM to 8AM and the following traffic characteristics were assessed: the average total delay of vehicles in the observed section (sec/min), the average number of vehicle stops in the observed section (stops/min).The verification was done in two steps.In the first step the intersection with the fixed time (FT) was tested and in the second step the fuzzy inference system (FIS) was tested.The aggregated values from all intersection approaches are represented in the Table 2.The results presented above have proven the benefit of the fuzzy inference system in decreasing the average total delay time.This is certainly a significant improvement, considering the simplicity of the proposed model and the fact that the fixed time control is really in use on the intersection of concern.

CONCLUSIONS AND NEXT STEPS
In this paper an approach for implementing a fuzzy control system directly within a microsimulation tool VISSIM was presented.It provides a detailed overview so that everybody can evaluate control strategies without a detailed knowledge of programming languages or the need to purchase an additional API.Simplification of such evaluation is really an important issue nowadays, so we believe that the described implementation approach can be very useful and can bring more advanced control strategies into use.This article has clearly shown the potential of the VisVAP software in the design of an advanced control system.The designed system can be applied, for example, to a level intersection with traffic lights, urban traffic control system, road line traffic control (speed harmonisation), ramp-metering or dynamic traffic assignment.
Next, this approach will be used in a larger project, in which different highway management strategies (including road line traffic control) will be compared in a microsimulation tool.This is, for example, true for project SIRID.Here an advanced algorithm for speed harmonisation on a highway will be developed as an improvement of the existing solution based on simple decision trees.Such a new algorithm will be evaluated with the use of a microsimulation model as a part of this project.

Figure 1 :Figure 2
Figure 1: Fuzzy signal controller and its relation to the model.The input variables VPT, VAG, and the output variable GTD are described in the next chapters.

Figure 3 :
Figure 3: The trapezoidal function and its parameterization (left) VisVAP flow chart of the trapezoidal function (right).

Table 1 : Table of all the fuzzy rules.
The next important decision affecting the performance of the model is the setting of the inference engine.Several different settings were tested.As the result, the following setting is used in this paper: