00001
00022 #ifndef TRAPMF_H_
00023 # define TRAPMF_H_
00024
00025 #include "MembershipFn.h"
00026
00027 namespace IRIS {
00028
00029 using namespace std;
00030
00031 namespace Fuzzy {
00032
00034 class TrapMF : public MembershipFn
00035 {
00036
00037 public:
00038
00040 static const unsigned NUM_PARMS = 4;
00041
00042
00043
00051 TrapMF( double a=0 , double b=0 , double c=0 , double d=0 );
00062 TrapMF( const string& name ,
00063 double a=0 , double b=0 , double c=0 , double d=0 ,
00064 double min=0 , double max=0 );
00067 TrapMF( const MembershipFn::parm_list& parm );
00068
00069
00070
00072 ~TrapMF( );
00073
00074
00075
00082 void set ( double a=0 , double b=0 , double c=0 , double d=0 );
00083
00084
00085 virtual void discretize( unsigned degree );
00086
00087
00088
00094 void get ( double &a , double &b , double &c , double &d );
00095
00096
00097 virtual double eval( double x ) const;
00098 virtual double operator() ( double val ) const;
00099
00100
00101 virtual void draw() const;
00102
00103 };
00104
00105 }
00106
00107 }
00108
00109 #endif