alvesoaj / eFLL

eFLL (Embedded Fuzzy Logic Library) is a standard library for Embedded Systems
MIT License
211 stars 91 forks source link

How do you generate FuzzyInputs? #6

Closed jpuriol closed 6 years ago

jpuriol commented 6 years ago

I have learned about Fuzzy Logic from this article: https://archive.org/details/ControlPIDFuzzyLogic-Fuzzy-LogicSystemSolvesControlProblemOCR.

I look a this code from the simple general example and I'm not a 100% sure what is doing:

// Criando o FuzzyInput distancia
FuzzyInput* distance = new FuzzyInput(1);
// Criando os FuzzySet que compoem o FuzzyInput distancia 
FuzzySet* small = new FuzzySet(0, 20, 20, 40); // Distancia pequena
distance->addFuzzySet(small); // Adicionando o FuzzySet small em distance
FuzzySet* safe = new FuzzySet(30, 50, 50, 70); // Distancia segura
distance->addFuzzySet(safe); // Adicionando o FuzzySet safe em distance
FuzzySet* big = new FuzzySet(60, 80, 80, 80); // Distancia grande
distance->addFuzzySet(big); // Adicionando o FuzzySet big em distance

My problem comes from the constructor of the FuzzySet(float a, float b, float c, float d). Could you help me understand what FuzzySet* small = new FuzzySet(0, 20, 20, 40) exactly means?

alvesoaj commented 6 years ago

It is just a configuration to set the pertinence function function; Depending on the parameters, it shuld be triangular, trapezoidal or singleton

jpuriol commented 6 years ago

How will you make it triangular? What shape has the example?

My problem is that I don't understand the general idea of the simple sample @zerokol

jpuriol commented 6 years ago

Never mind, @zerokol , I found on the documentation on english on yourwebsite. Thank you!