1 /*
2  fuzzylite (R), a fuzzy logic control library in C++.
3  Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved.
4  Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com>
5 
6  This file is part of fuzzylite.
7 
8  fuzzylite is free software: you can redistribute it and/or modify it under
9  the terms of the FuzzyLite License included with the software.
10 
11  You should have received a copy of the FuzzyLite License along with
12  fuzzylite. If not, see <http://www.fuzzylite.com/license/>.
13 
14  fuzzylite is a registered trademark of FuzzyLite Limited.
15  */
16 
17 #include "fl/term/Term.h"
18 
19 #include "fl/imex/FllExporter.h"
20 #include "fl/term/Linear.h"
21 #include "fl/term/Function.h"
22 
23 namespace fl {
24 
Term(const std::string & name,scalar height)25     Term::Term(const std::string& name, scalar height) : _name(name), _height(height) { }
26 
~Term()27     Term::~Term() { }
28 
setName(const std::string & name)29     void Term::setName(const std::string& name) {
30         this->_name = name;
31     }
32 
getName() const33     std::string Term::getName() const {
34         return this->_name;
35     }
36 
setHeight(scalar height)37     void Term::setHeight(scalar height) {
38         this->_height = height;
39     }
40 
getHeight() const41     scalar Term::getHeight() const {
42         return this->_height;
43     }
44 
toString() const45     std::string Term::toString() const {
46         return FllExporter().toString(this);
47     }
48 
updateReference(const Engine * engine)49     void Term::updateReference(const Engine* engine) {
50         FL_IUNUSED(engine);
51         //do nothing
52     }
53 
tsukamoto(scalar activationDegree,scalar minimum,scalar maximum) const54     scalar Term::tsukamoto(scalar activationDegree, scalar minimum, scalar maximum) const {
55         FL_IUNUSED(minimum);
56         FL_IUNUSED(maximum);
57         return membership(activationDegree);
58     }
59 
isMonotonic() const60     bool Term::isMonotonic() const {
61         return false;
62     }
63 
64 
65 }
66