TrapezoidalTerm.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* Copyright 2010 Juan Rada-Vilela
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. */
  12. /*
  13. * TrapezoidalTerm.h
  14. *
  15. * Created on: Dec 13, 2009
  16. * Author: jcrada
  17. */
  18. #ifndef FL_TRAPEZOIDALTERM_H_
  19. #define FL_TRAPEZOIDALTERM_H_
  20. #include "LinguisticTerm.h"
  21. namespace fl {
  22. class TrapezoidalTerm : public LinguisticTerm {
  23. private:
  24. flScalar _b;
  25. flScalar _c;
  26. public:
  27. TrapezoidalTerm();
  28. TrapezoidalTerm(const std::string& name, flScalar minimum = -INFINITY,
  29. flScalar maximum = INFINITY);
  30. TrapezoidalTerm(const FuzzyOperator& fuzzy_op, const std::string& name,
  31. flScalar minimum = -INFINITY, flScalar maximum = INFINITY);
  32. virtual ~TrapezoidalTerm();
  33. virtual void setA(flScalar a);
  34. virtual flScalar a() const;
  35. virtual void setB(flScalar b);
  36. virtual flScalar b() const;
  37. virtual void setC(flScalar c);
  38. virtual flScalar c() const;
  39. virtual void setD(flScalar d);
  40. virtual flScalar d() const;
  41. virtual TrapezoidalTerm* clone() const;
  42. virtual flScalar membership(flScalar crisp) const;
  43. virtual eMembershipFunction type() const;
  44. virtual std::string toString() const;
  45. };
  46. } // namespace fuzzy_lite
  47. #endif /* FL_TRAPEZOIDALTERM_H_ */