SingletonTerm.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. * SingletonTerm.h
  14. *
  15. * Created on: Jan 7, 2010
  16. * Author: jcrada
  17. */
  18. #ifndef FL_SINGLETONTERM_H_
  19. #define FL_SINGLETONTERM_H_
  20. #include "LinguisticTerm.h"
  21. namespace fl {
  22. class SingletonTerm : public LinguisticTerm {
  23. private:
  24. flScalar _value;
  25. public:
  26. SingletonTerm();
  27. SingletonTerm(const std::string& name, flScalar value = NAN);
  28. SingletonTerm(const FuzzyOperator& fuzzy_op, const std::string& name,
  29. flScalar value = NAN);
  30. virtual ~SingletonTerm();
  31. virtual void setValue(flScalar value);
  32. virtual flScalar value() const;
  33. virtual SingletonTerm* clone() const;
  34. virtual flScalar membership(flScalar crisp) const;
  35. virtual eMembershipFunction type() const;
  36. virtual std::string toString() const;
  37. };
  38. } // namespace fl
  39. #endif /* FL_SINGLETONTERM_H_ */