Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

TrapezoidalFunction.h

00001 // Copyright (C) 2000 Dominic Letourneau (dominic.letourneau@courrier.usherb.ca)
00002 
00003 // TrapezoidalFunction.h: interface for the TrapezoidalFunction class.
00004 //
00006 #ifndef _TRAPEZOIDALFUNCTION_H_
00007 #define _TRAPEZOIDALFUNCTION_H_
00008 
00009 
00010 #include <string>
00011 #include "FuzzyFunction.h"
00012 
00013 
00014 namespace FD {
00015 
00016 class TrapezoidalFunction : public FuzzyFunction  {
00017 
00018 public:
00019 
00020   virtual std::string get_type() {return std::string("Trapezoidal");}
00021   
00022   //evaluation of the function 
00023   virtual float evaluate(float x);
00024   
00025   //constructor of the function
00026   TrapezoidalFunction(const std::string &name, float a, float b, float c, float d);
00027   
00028   TrapezoidalFunction(std::string nodeName, ParameterSet params);
00029 
00030   TrapezoidalFunction(std::istream &in) {readFrom(in);}
00031 
00032   TrapezoidalFunction() {}
00033   
00034   //destructor
00035   virtual ~TrapezoidalFunction();
00036   
00037   //area evaluation
00038   virtual float get_area();
00039   
00040   //cog evaluation
00041   virtual float get_center_of_gravity();
00042   
00043   //lower limits of the function
00044   virtual float get_upper_bound() {return m_d;}
00045   
00046   //higher limit of the functions
00047   virtual float get_lower_bound() {return m_a;}
00048   
00049   //get all bounds of the function
00050   virtual Vector<float> get_bounds();
00051 
00052   //cloning capability
00053   virtual ObjectRef clone();
00054   
00055   virtual void printOn(std::ostream &out=std::cout) const;
00056   
00057   virtual void readFrom(std::istream &in=std::cin);
00058   
00059  private:
00060   
00061   //function limits
00062   float m_a;
00063   float m_b;
00064   float m_c;
00065   float m_d;
00066   
00067 };
00068 
00069 }//namespace FD
00070 
00071 #endif 

Generated on Wed Oct 5 14:28:56 2005 for FlowDesigner by  doxygen 1.4.4