-
Notifications
You must be signed in to change notification settings - Fork 93
/
FuzzyRuleAntecedent.h
executable file
·56 lines (52 loc) · 1.75 KB
/
FuzzyRuleAntecedent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Robotic Research Group (RRG)
* State University of Piauí (UESPI), Brazil - Piauí - Teresina
*
* FuzzyRuleAntecedent.h
*
* Author: AJ Alves <aj.alves@zerokol.com>
* Co authors: Dr. Ricardo Lira <ricardor_usp@yahoo.com.br>
* Msc. Marvin Lemos <marvinlemos@gmail.com>
* Douglas S. Kridi <douglaskridi@gmail.com>
* Kannya Leal <kannyal@hotmail.com>
*/
#ifndef FUZZYRULEANTECEDENT_H
#define FUZZYRULEANTECEDENT_H
// IMPORTING NECESSARY LIBRARIES
#include <stdlib.h>
#include "FuzzySet.h"
// CONSTANTS
// possible logic operators
#define OP_AND 1
#define OP_OR 2
// possible join associations modes
#define MODE_FS 1
#define MODE_FS_FS 2
#define MODE_FS_FRA 3
#define MODE_FRA_FRA 4
class FuzzyRuleAntecedent
{
public:
// CONTRUCTORS
FuzzyRuleAntecedent();
// PUBLIC METHODS
bool joinSingle(FuzzySet *fuzzySet);
bool joinWithAND(FuzzySet *fuzzySet1, FuzzySet *fuzzySet2);
bool joinWithOR(FuzzySet *fuzzySet1, FuzzySet *fuzzySet2);
bool joinWithAND(FuzzySet *fuzzySet, FuzzyRuleAntecedent *fuzzyRuleAntecedent);
bool joinWithAND(FuzzyRuleAntecedent *fuzzyRuleAntecedent, FuzzySet *fuzzySet);
bool joinWithOR(FuzzySet *fuzzySet, FuzzyRuleAntecedent *fuzzyRuleAntecedent);
bool joinWithOR(FuzzyRuleAntecedent *fuzzyRuleAntecedent, FuzzySet *fuzzySet);
bool joinWithAND(FuzzyRuleAntecedent *fuzzyRuleAntecedent1, FuzzyRuleAntecedent *fuzzyRuleAntecedent2);
bool joinWithOR(FuzzyRuleAntecedent *fuzzyRuleAntecedent1, FuzzyRuleAntecedent *fuzzyRuleAntecedent2);
float evaluate();
private:
// PRIVATE VARIABLES
int op;
int mode;
FuzzySet *fuzzySet1;
FuzzySet *fuzzySet2;
FuzzyRuleAntecedent *fuzzyRuleAntecedent1;
FuzzyRuleAntecedent *fuzzyRuleAntecedent2;
};
#endif