Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef FuzzySetH
00033 #define FuzzySetH
00034
00035 #include <zeusmath/Config/PlatformDefines.hpp>
00036 #include <zeusbase/System/ZObject.h>
00037
00038 BEGIN_NAMESPACE_Zeus
00039
00040
00044
00045 zeusmath_class TFuzzySet : public TZObject
00046 {
00047 public:
00048
00049
00052
00053 enum EFuzzyNorm
00054 {
00055 etZadeh,
00056 etProdConnect,
00057 etLukasiewiez,
00058 etYager
00059 };
00060
00061
00064
00065 enum EDefuzzyMethod
00066 {
00067 etCenterOfGrapvity,
00068 etIndexedCenterOfGravity,
00069 etCenterOfSums,
00070 etFirstOfMaximum,
00071 etMiddleOfMaximum,
00072 etLastOfMaximum
00073 };
00074
00075
00076 TFuzzySet(Int iResolution = 100);
00077 TFuzzySet(const TFuzzySet& set);
00078 virtual ~TFuzzySet();
00079
00080 void initTrapezodial(const Float& rfX1, const Float& rfX2, const Float& rfX3, const Float& rfX4);
00081 void initGaussianSyn(const Float& rfA, const Float& rfWhm);
00082 void initGaussianAsyn(const Float& rfA, const Float& rfWhm1, const Float& rfWhm2);
00083 void initSigmodial(const Float& rfA, const Float& rfB);
00084
00085 Float getValue(Int iIndex) const;
00086 Float getMemberShip(const Float& rfX) const;
00087 Int getResolution() const;
00088 void setValue(Int iIndex, const Float& rfValue);
00089
00090 virtual Float getDefuzzificationValue(EDefuzzyMethod eMethod = etCenterOfGrapvity, const Float& rfParam = 1.0) const;
00091
00092 virtual TFuzzySet unionS(const TFuzzySet& set, EFuzzyNorm eNorm = etZadeh, const Float& rfParam = 1.0) const;
00093 virtual TFuzzySet intersectS(const TFuzzySet& set, EFuzzyNorm eNorm = etZadeh, const Float& rfParam = 1.0) const;
00094 virtual TFuzzySet notS() const;
00095 virtual TFuzzySet concentrate() const;
00096 virtual TFuzzySet dilate() const;
00097 virtual TFuzzySet intense() const;
00098
00099 virtual TFuzzySet lingVery() const;
00100 virtual TFuzzySet lingMoreOrLess() const;
00101 virtual TFuzzySet lingVeryVery() const;
00102 virtual TFuzzySet lingNotVery() const;
00103 virtual TFuzzySet lingMore() const;
00104 virtual TFuzzySet lingLess() const;
00105
00106 TFuzzySet& operator=(const TFuzzySet& set);
00107 bool operator==(const TFuzzySet& set) const;
00108
00109
00110 protected:
00112 TArrayList<Float> m_lstValues;
00114 Int m_iResolution;
00115
00116 Float sum() const;
00117 };
00118
00119
00123
00124 inline Int TFuzzySet::getResolution() const
00125 {
00126 return m_iResolution;
00127 }
00128
00129
00134
00135 inline Float TFuzzySet::getValue(Int iIndex) const
00136 {
00137 return m_lstValues.getItemConst(iIndex);
00138 }
00139
00140
00145
00146 inline void TFuzzySet::setValue(Int iIndex, const Float& rfValue)
00147 {
00148 m_lstValues[iIndex] = rfValue;
00149 }
00150
00151
00154
00155 inline TFuzzySet TFuzzySet::lingVery() const
00156 {
00157 return this->concentrate();
00158 }
00159
00160
00163
00164 inline TFuzzySet TFuzzySet::lingMoreOrLess() const
00165 {
00166 return this->dilate();
00167 }
00168
00169
00172
00173 inline TFuzzySet TFuzzySet::lingVeryVery() const
00174 {
00175 return this->concentrate().concentrate();
00176 }
00177
00178
00181
00182 inline TFuzzySet TFuzzySet::lingNotVery() const
00183 {
00184 return this->concentrate().notS();
00185 }
00186
00187
00188 END_NAMESPACE_Zeus
00189
00190 #endif