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

TriangularFunction.h

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

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