GaussianProduct.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. Author: Juan Rada-Vilela, Ph.D.
  3. Copyright (C) 2010-2014 FuzzyLite Limited
  4. All rights reserved
  5. This file is part of fuzzylite.
  6. fuzzylite is free software: you can redistribute it and/or modify it under
  7. the terms of the GNU Lesser General Public License as published by the Free
  8. Software Foundation, either version 3 of the License, or (at your option)
  9. any later version.
  10. fuzzylite is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
  13. for more details.
  14. You should have received a copy of the GNU Lesser General Public License
  15. along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
  16. fuzzylite™ is a trademark of FuzzyLite Limited.
  17. */
  18. #ifndef FL_GAUSSIANPRODUCT_H
  19. #define FL_GAUSSIANPRODUCT_H
  20. #include "fl/term/Term.h"
  21. namespace fl {
  22. class FL_API GaussianProduct : public Term {
  23. protected:
  24. scalar _meanA;
  25. scalar _standardDeviationA;
  26. scalar _meanB;
  27. scalar _standardDeviationB;
  28. public:
  29. GaussianProduct(const std::string& name = "",
  30. scalar meanA = fl::nan,
  31. scalar standardDeviationA = fl::nan,
  32. scalar meanB = fl::nan,
  33. scalar standardDeviationB = fl::nan,
  34. scalar height = 1.0);
  35. virtual ~GaussianProduct() FL_IOVERRIDE;
  36. FL_DEFAULT_COPY_AND_MOVE(GaussianProduct)
  37. virtual std::string className() const FL_IOVERRIDE;
  38. virtual std::string parameters() const FL_IOVERRIDE;
  39. virtual void configure(const std::string& parameters) FL_IOVERRIDE;
  40. virtual scalar membership(scalar x) const FL_IOVERRIDE;
  41. virtual void setMeanA(scalar meanA);
  42. virtual scalar getMeanA() const;
  43. virtual void setStandardDeviationA(scalar sigmaA);
  44. virtual scalar getStandardDeviationA() const;
  45. virtual void setMeanB(scalar meanB);
  46. virtual scalar getMeanB() const;
  47. virtual void setStandardDeviationB(scalar sigmaB);
  48. virtual scalar getStandardDeviationB() const;
  49. virtual GaussianProduct* clone() const FL_IOVERRIDE;
  50. static Term* constructor();
  51. };
  52. }
  53. #endif /* FL_GAUSSIANPRODUCT_H */