Activated.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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_ACTIVATED_H
  19. #define FL_ACTIVATED_H
  20. #include "fl/term/Term.h"
  21. namespace fl {
  22. class TNorm;
  23. class FL_API Activated : public Term {
  24. protected:
  25. const Term* _term;
  26. scalar _degree;
  27. const TNorm* _activation;
  28. public:
  29. Activated(const Term* term = fl::null, scalar degree = 1.0,
  30. const TNorm* activationOperator = fl::null);
  31. virtual ~Activated() FL_IOVERRIDE;
  32. FL_DEFAULT_COPY_AND_MOVE(Activated)
  33. virtual std::string className() const FL_IOVERRIDE;
  34. virtual std::string parameters() const FL_IOVERRIDE;
  35. virtual void configure(const std::string& parameters) FL_IOVERRIDE;
  36. virtual scalar membership(scalar x) const FL_IOVERRIDE;
  37. virtual std::string toString() const FL_IOVERRIDE;
  38. virtual void setTerm(const Term* term);
  39. virtual const Term* getTerm() const;
  40. virtual void setDegree(scalar degree);
  41. virtual scalar getDegree() const;
  42. virtual void setActivation(const TNorm* activation);
  43. virtual const TNorm* getActivation() const;
  44. virtual Activated* clone() const FL_IOVERRIDE;
  45. };
  46. }
  47. #endif /* FL_ACTIVATED_H */