## Introduction

In a previous article, we discussed the basics of fuzzy sets and fuzzy inferencing. The report also illustrated the construction of a possible control application using a fuzzy inferencing method. In this article, we will build a multi-input/multi-output fuzzy inference system using the Python programming language. It is assumed that the reader has a clear understanding of fuzzy inferencing and has read the article mentioned previously.

All the code listed in this article is available on Github.

## System Architecture

The diagram below illustrates the structure of the application. The design is based on several considerations on Fuzzy Inference Systems, some being:

- A Fuzzy Inference System will require input and output variables and a collection of fuzzy rules.
- Both input and output variables will contain a collection of fuzzy sets if the Fuzzy Inference System is of Mamdani type.
- Input and output variables are very similar, but they are used differently by fuzzy rules. During execution, input variables use the input values to the system to fuzzify their sets, that is they determine the degree of belonging of that input value to all of the fuzzy sets of the variable. Each rule contributes to some extent to the output variables; the totality of this contribution will determine the output of the system.
- Fuzzy rules have the structure of the form;

```
if {antecedent clauses} then {consequent clauses}
```

Therefore a rule will contain several clauses of antecedent type and some clauses of consequent type. Clauses will be of the form:

```
{variable name} is {set name}
```

We will discuss some implementation details of the classes developed for this system in the following sections:

#python #fuzzy inference system