# Highway Travel-Time Forecasting with Greenshields Model-Based Cascaded Fuzzy Logic Systems
## 2 Traffic Data Collection and Status Prediction Modeling Methods
### Fuzzy Logic System Model Setup  
Fuzzy logic is widely applied in artificial intelligence, control systems, decision analysis, pattern recognition, and other fields [45; 46]. The basic structure of a fuzzy logic system consists of four key components: fuzzification, the inference engine, the fuzzy rule base, and defuzzification, as illustrated in Figure 5.  
The membership function in fuzzy logic describes the degree of membership of an element within a fuzzy set, where the degree indicates how strongly the element fits the characteristics of that set. The trapezoidal membership function, defined by four parameters \((a,b,c,d)\), is commonly used in many applications, as shown in Figure 6. It can be expressed by (6), where points \(a\) and \(b\) represent the start and end of the range with zero membership value, while points \(c\) and \(d\) define the vertices of the trapezoid where the membership value reaches its maximum. These parameters determine the shape of the trapezoid and the corresponding membership values of the fuzzy set [46].  
\[\mu(x)=\left\{\begin{array}{ll}0,&x<a\\ \frac{x-a}{c-a},&x\in[a,c]\\ 1,&x\in[c,d]\\ \frac{b-x}{b-d},&x\in[d,b]\\ 0,&x>b\end{array}\right. \tag{6}\]  
The Gaussian membership function is another frequently used type. Its graph is shown in Figure 7, defined  
Fuzzy rules establish an inference mechanism based on fuzzy logic, linking input and output variables through linguistic terms and fuzzy sets. These rules typically employ conditional statements with logical operators to perform fuzzy reasoning on fuzzy inputs, producing fuzzy outputs. By capturing the relationships between inputs and outputs, fuzzy rules enable flexible decision-making, which is essential in many control systems and artificial intelligence applications. The algorithm for fuzzy logic systems generally adopts an if-then clause structure, which can be written as [46]  
\[\text{If }(x_{1})\text{ is }(A_{1})\text{ and }\dots\text{ and }(x_{i})\text{ is }(A_{i})\text{ then }(y)\text{ is }(B),\text{ }i=1,2,3\dots,\text{ }n, \tag{8}\]  
where \(x_{i}\) are input parameters, \(y\) is the output parameter, \(A_{i}\) are the assumed conditions, \(B\) is the corresponding action based on these conditions, and \(n\) is the number of rules. Fuzzy rules also employ fuzzy logic operators such as AND, OR, and NOT to manage operations between fuzzy sets through a consistent and reasonable inference process, improving the system's accuracy and adaptability.  
Defuzzification is the final stage of the fuzzy logic system. It converts the inferred fuzzy results into a precise numerical output \(y(x)\). Typically, this output represents the center of area (COA) of the aggregated output membership function and is calculated as [46]  
\[y(x)=\frac{\sum_{i=1}^{N}y_{i}\mu(y_{i})}{\sum_{i=1}^{N}\mu(y_{i})}, \tag{9}\]  
where \(y_{i}\) is the output value of rule \(i\), and \(\mu(y_{i})\) is the corresponding membership degree of \(y_{i}\).  
Figure 6: Trapezoidal membership function.  
Figure 7: Gaussian membership function.