Fuzzy libray for embedded targets developed by zerokol. Read more on: http://zerokol.com/product/51e93616e84c5571b7000018/2/en edit by Bruno Alfano - corrected deallocation of FuzzyOutput

Fuzzy library by Zerokol. Read more on: http://zerokol.com/product/51e93616e84c5571b7000018/2/en

edit by Bruno Alfano - corrected deallocation bug for FuzzyOutput

Committer:
astaff15
Date:
Wed Jun 24 15:08:13 2015 +0000
Revision:
2:460b409e26e8
Parent:
1:d545f709646b
Corrected FuzzyOutput destructor bug

Who changed what in which revision?

UserRevisionLine numberNew contents of line
astaff15 0:66cd67db4f1b 1 /*
astaff15 0:66cd67db4f1b 2 * Robotic Research Group (RRG)
astaff15 0:66cd67db4f1b 3 * State University of Piaui (UESPI), Brazil - Piauí - Teresina
astaff15 0:66cd67db4f1b 4 *
astaff15 0:66cd67db4f1b 5 * FuzzyComposition.h
astaff15 0:66cd67db4f1b 6 *
astaff15 0:66cd67db4f1b 7 * Author: Msc. Marvin Lemos <marvinlemos@gmail.com>
astaff15 0:66cd67db4f1b 8 * AJ Alves <aj.alves@zerokol.com>
astaff15 0:66cd67db4f1b 9 * Co authors: Douglas S. Kridi <douglaskridi@gmail.com>
astaff15 0:66cd67db4f1b 10 * Kannya Leal <kannyal@hotmail.com>
astaff15 0:66cd67db4f1b 11 */
astaff15 0:66cd67db4f1b 12 #ifndef FUZZYCOMPOSITION_H
astaff15 0:66cd67db4f1b 13 #define FUZZYCOMPOSITION_H
astaff15 0:66cd67db4f1b 14
astaff15 0:66cd67db4f1b 15 // IMPORTANDO AS BIBLIOTECAS NECESSÁRIAS
astaff15 0:66cd67db4f1b 16 #include <stdlib.h>
astaff15 0:66cd67db4f1b 17
astaff15 0:66cd67db4f1b 18 // CONSTANTES
astaff15 0:66cd67db4f1b 19 #define EPS 1.0E-3
astaff15 0:66cd67db4f1b 20
astaff15 0:66cd67db4f1b 21 // Estrutura de uma lista para guardar os pontos
astaff15 0:66cd67db4f1b 22 struct pointsArray{
astaff15 0:66cd67db4f1b 23 pointsArray* previous;
astaff15 0:66cd67db4f1b 24 float point;
astaff15 0:66cd67db4f1b 25 float pertinence;
astaff15 0:66cd67db4f1b 26 pointsArray* next;
astaff15 0:66cd67db4f1b 27 };
astaff15 0:66cd67db4f1b 28
astaff15 0:66cd67db4f1b 29 class FuzzyComposition{
astaff15 0:66cd67db4f1b 30 public:
astaff15 0:66cd67db4f1b 31 // CONSTRUTORES
astaff15 0:66cd67db4f1b 32 FuzzyComposition();
astaff15 0:66cd67db4f1b 33 // DESTRUTOR
astaff15 0:66cd67db4f1b 34 ~FuzzyComposition();
astaff15 0:66cd67db4f1b 35 // MÉTODOS PÚBLICOS
astaff15 0:66cd67db4f1b 36 bool addPoint(float point, float pertinence);
astaff15 0:66cd67db4f1b 37 bool checkPoint(float point, float pertinence);
astaff15 0:66cd67db4f1b 38 bool build();
astaff15 0:66cd67db4f1b 39 float avaliate();
astaff15 0:66cd67db4f1b 40 bool empty();
astaff15 1:d545f709646b 41
astaff15 0:66cd67db4f1b 42
astaff15 0:66cd67db4f1b 43 private:
astaff15 0:66cd67db4f1b 44 // VARIÁVEIS PRIVADAS
astaff15 0:66cd67db4f1b 45 pointsArray* pointsCursor;
astaff15 0:66cd67db4f1b 46 pointsArray* points;
astaff15 0:66cd67db4f1b 47
astaff15 0:66cd67db4f1b 48 // MÉTODOS PRIVADOS
astaff15 0:66cd67db4f1b 49 void cleanPoints(pointsArray* aux);
astaff15 0:66cd67db4f1b 50 bool rebuild(pointsArray* aSegmentBegin, pointsArray* aSegmentEnd, pointsArray* bSegmentBegin, pointsArray* bSegmentEnd);
astaff15 0:66cd67db4f1b 51 bool rmvPoint(pointsArray* point);
astaff15 0:66cd67db4f1b 52 };
astaff15 0:66cd67db4f1b 53 #endif