FuzzyConsequent.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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: FuzzyConsequent.h
  14. * Author: jcrada
  15. *
  16. * Created on March 2, 2010, 7:05 PM
  17. */
  18. #ifndef FL_FUZZYCONSEQUENT_H
  19. #define FL_FUZZYCONSEQUENT_H
  20. #include "OutputLVar.h"
  21. #include <string>
  22. #include "FuzzyExceptions.h"
  23. #include "FuzzyEngine.h"
  24. namespace fl {
  25. class FuzzyConsequent {
  26. private:
  27. OutputLVar* _output_lvar;
  28. flScalar _weight;
  29. public:
  30. FuzzyConsequent();
  31. virtual ~FuzzyConsequent();
  32. virtual void setOutputLVar(OutputLVar* output_lvar);
  33. virtual OutputLVar* outputLVar() const;
  34. virtual void setWeight(flScalar weight);
  35. virtual flScalar weight() const;
  36. virtual void parse(const std::string& consequent,
  37. const FuzzyEngine& engine) throw (ParsingException) = 0;
  38. virtual void execute(flScalar degree) = 0;
  39. virtual std::string toString() const = 0;
  40. static void main(int argc, char** argv);
  41. };
  42. }
  43. #endif /* FL_FUZZYCONSEQUENT_H */