#include <LinguisticVariable.h>

Public Member Functions | |
| LinguisticVariable (const std::string name="", double lowerBound=-std::numeric_limits< double >::max(), double upperBound=std::numeric_limits< double >::max()) | |
| The constructor sets the name and the range for the new linguistic variable, e.g. | |
| virtual | ~LinguisticVariable () |
| Destructor. | |
| std::string | getName () const |
| Returns the name of the linguistic variable. | |
| void | setName (const std::string name) |
| Sets the name of the linguistic variable. | |
| void | addTerm (LinguisticTerm *lt) |
| Adds a new linguistic term. | |
| void | removeTerm (LinguisticTerm *lt) |
| Removes the given LinguisticTerm from this variable. | |
| int | getNumberOfTerms () |
| Returns number of terms associated with the LinguisticVariable. | |
| const RCPtr< LinguisticTerm > | getTerm (int whichOne) |
| Returns a LinguisticTerm associated with this variable. | |
| void | setBounds (double lower, double upper) |
| Sets a new range for the variable. | |
| double | getLowerBound () |
| Returns the lower bound of the variables range. | |
| double | getUpperBound () |
| Returns the upper bound of the variables range. | |
| const RCPtr< LinguisticTerm > | findLT (std::string name) |
| Returns an LinguisticTerm object specified by its name. | |
Static Public Member Functions | |
| static LinguisticVariable * | getLV (std::string name) |
| Returns the linguistic variable for the given name if existent or throws FuzzyException otherwise. | |
A linguistic variable combines linguistic terms like 'slow', 'moderately fast', 'fast', 'unbelievable fast' under a new name, e.g. 'speed'.
Definition at line 36 of file LinguisticVariable.h.
| LinguisticVariable::LinguisticVariable | ( | const std::string | name = "", |
|
| double | lowerBound = -std::numeric_limits<double>::max(), |
|||
| double | upperBound = std::numeric_limits<double>::max() | |||
| ) |
The constructor sets the name and the range for the new linguistic variable, e.g.
( "Temperature", -10, 120 ).
The bounds also hold for the support of all derived fuzzy sets, i.e. regions outside these bounds are ignored for defuzzyfication.
| name | the variables name, e.g. "Temperature" | |
| lowerBound | lower bound of the variables range | |
| upperBound | upper bound of the variables range |
Definition at line 45 of file LinguisticVariable.cpp.
| LinguisticVariable::~LinguisticVariable | ( | ) | [virtual] |
| void LinguisticVariable::addTerm | ( | LinguisticTerm * | lt | ) |
Adds a new linguistic term.
This method shouldn't be necessary most of time, since a LinguisticTerm is associated with its LinguisticVariable durin construction.
| lt | the LinguisticTerm to add |
Definition at line 64 of file LinguisticVariable.cpp.
| const RCPtr< LinguisticTerm > LinguisticVariable::findLT | ( | std::string | name | ) |
Returns an LinguisticTerm object specified by its name.
| name | the name of the designated LinguisticTerm |
Definition at line 92 of file LinguisticVariable.cpp.
Referenced by Rule::Rule().
| double LinguisticVariable::getLowerBound | ( | ) | [inline] |
Returns the lower bound of the variables range.
Definition at line 105 of file LinguisticVariable.h.
| LinguisticVariable * LinguisticVariable::getLV | ( | std::string | name | ) | [static] |
Returns the linguistic variable for the given name if existent or throws FuzzyException otherwise.
Definition at line 28 of file LinguisticVariable.cpp.
Referenced by Rule::Rule().
| std::string LinguisticVariable::getName | ( | ) | const |
| int LinguisticVariable::getNumberOfTerms | ( | ) | [inline] |
Returns number of terms associated with the LinguisticVariable.
Definition at line 84 of file LinguisticVariable.h.
Referenced by getTerm().
| const RCPtr< LinguisticTerm > LinguisticVariable::getTerm | ( | int | whichOne | ) |
Returns a LinguisticTerm associated with this variable.
| whichOne | index of the term ( 0 <= index < numerOfTerms ) |
Definition at line 79 of file LinguisticVariable.cpp.
References getNumberOfTerms().
| double LinguisticVariable::getUpperBound | ( | ) | [inline] |
Returns the upper bound of the variables range.
Definition at line 110 of file LinguisticVariable.h.
| void LinguisticVariable::removeTerm | ( | LinguisticTerm * | lt | ) |
Removes the given LinguisticTerm from this variable.
| lt | the LinguisticTerm to remove |
Definition at line 69 of file LinguisticVariable.cpp.
| void LinguisticVariable::setBounds | ( | double | lower, | |
| double | upper | |||
| ) |
Sets a new range for the variable.
The bounds also hold for the support of all derived fuzzy sets.
| lower | the lower bound | |
| upper | the upper bound |
Definition at line 59 of file LinguisticVariable.cpp.
| void LinguisticVariable::setName | ( | const std::string | name | ) |
Sets the name of the linguistic variable.
| name | the new name |
Definition at line 55 of file LinguisticVariable.cpp.