# Smart Pedestrian Crossing Management at Traffic Light Junctions through a Fuzzy-Based Approach
## 3 The Proposed Fuzzy Logic Controller
On the contrary, for the phases of the traffic light (output), the values are related to the configuration of the traffic light regarding the green, yellow and red times. The triangular membership functions of the pedestrians number are represented in Figure 6, where the degree of membership is realized by normalized values [0 \(\div\) 1]. Regarding the time of day, it is not possible to obtain a continuous numerical range as for the the pedestrian number. In fact, there may be hours where the traffic light junction is more crowded concerning vehicles and pedestrians, while in others, the situation may be somewhat more regular and almost linear. For this reason, considering the signalized road intersection located in the urban area of Enna, introduced in Section 2, the following time intervals, represented through the symbol \(\div\), have been labeled as \"_Critical_\":  
* 07:00 a.m. \(\div\) 09:00 a.m.;
* 01:00 p.m. \(\div\) 02:00 p.m.;
* 05:00 p.m. \(\div\) 06:00 p.m.  
Figure 5: Proposed Fuzzy Logic Controller (FLC) Architecture. i.e., for instance, the first interval extends between 07:00 a.m. and 09:00 a.m. On the contrary, the other hours of the day have been identified as \"_Not Critical_\". The traffic-light cycle considered in the proposed approach is related to two phases along the two roads (Figure 1). The set for the overall traffic light cycle can be 84 s (i.e., 30 for green, 49 for red and 5 for yellow) or 94 s (i.e., 25 for green, 64 for red and 5 for yellow). This cycle of 84 or 94 s is related only to the traffic light and does not represent an input/output parameter of the FLC. The output of the FLC defines the variation of this set by increasing or decreasing green and red times. Concerning the phases of traffic lights for pedestrians, the values of green, yellow and red times, updated dynamically based on the membership function (_Low, Medium_, _High_ ), are shown in Table 3. In detail, for instance, considering the 84-s cycle, the standard values of green, yellow and red times (i.e., _Low_ membership function) are 30, 5 and 49 s. When the value of the membership function falls in the _Medium_ range, then the green time will have an increase of about 33%, while in the _High_ range, the improvement is about 66%. Consequently, the red time is reduced. The same mechanism is implemented for the 94-s cycle. As depicted in Table 4, the output value of the FLC is specified through six fuzzy rules based on the _IF-THEN_statement of traditional programming languages. For instance, considering Rule 1, if _Time of the day_is _Critical_ and _Pedestrians number_ is _Low_, the _Traffic light phase_ will be _Medium_. As is recognized, in an inference mechanism, the outputs are fuzzy variables. For this reason, the fuzzy logic controller needs to convert its internal fuzzy output variables into crisp values, by the defu  
Figure 6: Membership functions of the pedestrian number. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Membership Function** & **Green Time (s)** & **Yellow Time (s)** & **Red Time (s)** \\ \hline  & 84 s cycle & & \\ \hline _Low_ & 30 & 5 & 49 \\ _Medium_ & 40 (i.e., about +33\%) & 5 & 39 \\ _High_ & 50 (i.e., about +66\%) & 5 & 29 \\ \hline  & 94 s cycle & & \\ \hline _Low_ & 20 & 5 & 64 \\ _Medium_ & 45 (i.e., about +125\%) & 5 & 44 \\ _High_ & 55 (i.e., about +170\%) & 5 & 34 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Variation of the traffic light set. that the actual system can handle them. For instance, taking into account the cycle of the traffic light (84 or 94 s), if the output of the defuzzification process (i.e., a numerical value and not a linguistic variable) falls in the Mediumrange, the direct result of Rule 1 (Table 4), previously analyzed, is related to the values shown in Table 3. In this case, the values of green, yellow and red times will be 40, 5 and 39 s for the 84 s cycle, while they will be 45, 5 and 44 for the 94-s cycle.