## 4 Methodology
### Overview of Mamdani-Type Fuzzy Inference  
[PERSON]'s approach was one of the first to construct a fuzzy control system, which demonstrated the practical application of fuzzy set theory. The Mamdani-type fuzzy inference system represents a departure from classical binary logic, which typically views conditions in black-or-white terms. Introduced to embody the complexity and gradation found in human reasoning, fuzzy logic allows for the representation of uncertainty and imprecision in computational systems. The Mamdani-type fuzzy inference system, shown in Figure 2, includes three steps:  
1. Fuzzification of the input variables;
2. Inference: evaluation and aggregation of the rule outputs;
3. Defuzzification. These three stages are connected to a fuzzy knowledge base, forming the foundation of a system that depends on four primary components. The first component is a fuzzification module--**Fuzzifier**. In the fuzzification step, crisp inputs are converted into fuzzy sets. These inputs are applied to the antecedents of the fuzzy rules. For instance, if the input is traffic density, e.g., the number of cars passing  
Figure 2: Mamdani-type fuzzy inference system. through an intersection in a half-hour period, it could be converted into fuzzy values like _'low'_, _'medium'_, or _'high'_. The second component is a **Fuzzy knowledge base**. This contains fuzzy rules that define the desired system behavior. For example, a simple rule in a traffic control system might be: \"If traffic density is high, then the traffic light should change more often\". The third component is an **Inference engine** shown in Figure 3. In MFIS, the inference engine plays a crucial role in processing input data and executing fuzzy logic to arrive at appropriate outputs. The fuzzy inference engine executes a process to map an input space to an output space using fuzzy logic principles. The key steps involve applying fuzzy logic operators and aggregating the results to produce a single output decision. For example, consider a rule:  
\[\text{``If $x$ is $A$ and $y$ is $B$, then $z$ is $C$''}. \tag{1}\]  
Here, \(A\), \(B\), and \(C\) are fuzzy sets in the input and output spaces. The fuzzy operator _'and'_ is typically implemented as a minimum or maximum operator:  
\[\mu_{R}\left(x,y\right)=\min\left(\mu_{A}(x),\,\mu_{B}(y)\right), \tag{2}\]  
where \(\mu_{R}\) is the membership function of the fuzzy rule \(R\), and \(\mu_{A}\) and \(\mu_{B}\) are the membership functions of the fuzzy sets \(A\) and \(B\) (Figure 4). Figure 4: Aggregation of rules using the graphical Mamdani-type inference method with crisp input values. Figure 3: Fuzzy inference engine. Let us consider the application of this in a traffic density control system, where the density is measured as the number of cars passing through an intersection in a half-hour period. In this context, the inference engine takes fuzzified inputs--categorized as _'low' medium'_, or _'high'_ traffic density--and applies fuzzy reasoning to determine the necessary duration of traffic light phases. For example, the fuzzy rules are created by traffic management experts and encapsulate practical traffic control strategies. These rules might specify, for instance:  
\[\text{``If traffic density is high, then extend the green light duration''.} \tag{3}\]  
\[\text{``If traffic density is low, then shorten the green light duration''.} \tag{4}\]  
These rules are applied using fuzzy logic operators such as _'and'_, _'or'_, and _'not'_, with the minimum operator commonly used for the _'and'_ condition in a Mamdani system. This means that the output fuzzy value for a rule is determined by the smallest membership value of the inputs involved in the rule. Once the inference engine evaluates the traffic density against these rules, each rule generates a fuzzy output value. These outputs must then be aggregated to form a single fuzzy set that reflects the collective decision of the system.