José Claudio / Mbed 2 deprecated QuadCopter-Sensor-Serial

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MembershipFunction.h Source File

MembershipFunction.h

00001 #ifndef MF_H
00002 #define MF_H
00003 
00004 #include <stdlib.h>
00005 
00006 #define NULL    0
00007 
00008 enum mfType {TRIMF, TRAPMF, GUASSMF};
00009 
00010 class MembershipFunction
00011 {
00012     public:
00013         MembershipFunction(mfType type, float a, float b, float c, float d, float u, float v);
00014         MembershipFunction(mfType type);
00015         virtual ~MembershipFunction(void);
00016 
00017         float getValue(float x);
00018         void setValues(float a, float b, float c);
00019         void setValues(float a, float b, float c, float d);
00020         void setValues(float u, float v);
00021 
00022         float centroid(float h);
00023     
00024     private:
00025         mfType type;
00026     
00027         float a, b, c, d;
00028         float u, v;
00029         
00030         float trimf(float x);
00031         float trapmf(float x);
00032         float guassmf(float x);
00033 };
00034 
00035 #endif