FuzzyAntecedent.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. * File: FuzzyAntecedent.h
  14. * Author: jcrada
  15. *
  16. * Created on March 3, 2010, 12:28 AM
  17. */
  18. #ifndef FL_FUZZYANTECEDENT_H
  19. #define FL_FUZZYANTECEDENT_H
  20. #include "flScalar.h"
  21. #include <string>
  22. #include "FuzzyExceptions.h"
  23. #include "FuzzyOperator.h"
  24. #include "InputLVar.h"
  25. #include "FuzzyEngine.h"
  26. namespace fl {
  27. class FuzzyAntecedent {
  28. private:
  29. const FuzzyOperator* _fuzzy_operator;
  30. const InputLVar* _input_lvar; //e.g. power
  31. public:
  32. FuzzyAntecedent();
  33. FuzzyAntecedent(const FuzzyOperator& fuzzy_op);
  34. virtual ~FuzzyAntecedent();
  35. virtual void setFuzzyOperator(const FuzzyOperator& fuzzy_op);
  36. virtual const FuzzyOperator& fuzzyOperator() const;
  37. virtual void setInputLVar(const InputLVar* input_lvar);
  38. virtual const InputLVar* inputLVar() const;
  39. virtual flScalar degreeOfTruth() const = 0;
  40. virtual std::string toString() const = 0;
  41. virtual void parse(const std::string& antecedent,
  42. const FuzzyEngine& engine) throw (ParsingException) = 0;
  43. };
  44. }
  45. #endif /* FL_FUZZYANTECEDENT_H */