# Investigation of Critical Gap for Pedestrian Crossing Using Fuzzy Logic System
## 3 Fuzzification Process  
The fuzzification process is the first step in the fuzzy logic system. At this stage, converting the input data into a fuzzy set is implemented through fuzzy linguistic variables and membership functions. In order to fuzzify the input and output factors, it is common practice to adopt three to seven linguistic variables. Less than three values would be inefficient and would make it hard to differentiate the output after fuzzy inference [30; 31]. More than seven would complicate the number of fuzzy rules used.  
Figure 3: Fuzzy logic system for pedestrians’ gap acceptance.  
In this case, the membership function in the fuzzification process is constructed using three parameters {a, b, c} for each input and output variable, denoting low, medium and high values of each of the inputs, with variable ranges presented in Table 1. The estimation toolbox included in MATLAB was adopted. The triangular membership function, which is specified by the three parameters a, b and c, represents the z coordinates of the three vertices in a fuzzy set L (a and c are the lower and upper boundaries, where membership degree is 0; b is the center, where membership degree is 1), as presented by the equation below:  
\[\mu_{L}(x)=\begin{cases}0&\text{if z}\leq a\\ \frac{z-a}{b-a}&\text{if a}\leq z\leq b\\ \frac{c-z}{c-b}&\text{if b}\leq z\leq c\\ 0&\text{if z}\geq c\end{cases}\]  
Using this toolbox, the real-time data can then be matched with the adopted fuzzy model and have a mathematical justification for selecting a determined value for a rule, such as sum-of-squared-error minimization or any other suitable rule. The fuzzy system used for predicting the critical gap for pedestrians crossing is created from the knowledge of the inputs (number and lengths of rejected gaps and length of accepted gaps) and the output of the fuzzy logic system (the critical gaps).  
The observed length of accepted gaps has been assigned to one of three ranges of membership functions: low (0-1.75 s), medium (1.75-5.62 s) or high (5.62-7.6 s). Similarly, this has been done for all input and output variables (Table 1). Table 1 and Figure 4 show the values and structure of inputs, outputs and critical gap values for the three adopted ranges from the survey data.  
Figures 5 and 6 show the three levels of inputs and the three levels of outputs in the fuzzy logic system and the ranges of membership functions for the inputs and outputs respectively.  
As shown in the inputs and outputs of the fuzzy system, the used membership functions are of a triangle type. As discussed earlier, triangle membership functions constitute one amongst a range of possibilities yielding the optimal values of the introduced criteria. While the simplicity of this partition becomes evident, it does not preclude that one could construct some other partitions that are optimal in the sense of the assumed criteria for the input and output interface and simultaneously perform better when it comes to the optimization of the processing block itself.  
Figure 4: Fuzzification process.  
Figure 5: Low, medium and high ranges for inputs.  
Figure 6: Low, medium, and high ranges for outputs.