MembershipFn.h

Go to the documentation of this file.
00001 
00020 #ifndef         MEMBERSHIPFN_H_
00021 # define        MEMBERSHIPFN_H_
00022 
00023 #include <utility>   // for STL pair
00024 #include <vector>    // for STL vector
00025 #include "Numeric.h" // for Set
00026 #include "Set.h"     // for Set
00027 
00028 
00030 namespace IRIS {
00031 
00032   using namespace std;
00033 
00036   namespace Fuzzy {
00037 
00041     class MembershipFn : public Numeric
00042     {
00043 
00044       public:
00045 
00048         typedef pair<double,double> interval;
00050         typedef std::vector<double> parm_list; 
00051 
00052     //  CONSTRUCTORS  /////////////////////////////////////////////////////
00053 
00055         MembershipFn( );
00058         MembershipFn( const parm_list& parm );
00061         MembershipFn( const string& name );
00067         MembershipFn( const string& name , double min , double max );
00068 
00069     //  DESTRUCTORS  //////////////////////////////////////////////////////
00070 
00072         ~MembershipFn( );
00073 
00074     //  SET MEMBER FUNCTIONS (MUTATORS)  //////////////////////////////////
00075 
00080         void set( const string& name , double min , double max );
00084         void set( double newMin , double newMax );
00087         void setMin( double newMin );
00090         void setMax( double newMax );
00094         void set ( unsigned i , double val );
00096         void clear( );
00097 
00098         // IRIS::Fuzzy::Numeric virtual function not implemented here
00099         virtual void discretize( unsigned degree ) = 0;
00100 
00101     //  GET MEMBER FUNCTIONS (ACCESSORS)  /////////////////////////////////
00102 
00107         void get( string& name , double& min , double& max ) const ;
00111         void get( double& min , double& max ) const ;
00113         double getMin( ) const ;
00115         double getMax( ) const ;
00117         interval get( ) const ;
00120         interval dom( ) const ;
00121 
00123         double get ( unsigned i );
00124 
00125         // implemented virtual functions from IRIS::Fuzzy::Set
00126         virtual void draw( ) const ;
00127 
00128         // additional virtual functions for derived classes
00131         virtual double eval( double x ) const = 0;
00134         virtual double operator() ( double val ) const = 0;
00135 
00136       protected:
00137 
00138         interval   range;      // range of values
00139         parm_list  parameter;  // list of parameters
00140 
00141     }; // end of MembershipFn class
00142 
00143   } // end of Fuzzy namespace
00144 
00145 } // end of IRIS namespace
00146 
00147 #endif      /* !MEMBERSHIPFN_H_ */

Generated on Tue Dec 12 13:41:39 2006 for IRIS Intelligent Systems Tools by  doxygen 1.4.6