A class representing a LinguisticVariable. More...
#include <LinguisticVariable.h>
Public Member Functions | |
LinguisticVariable (const std::string &name, std::pair< double, double > range) | |
Constructs a LinguisticVariable with the given name and range. | |
void | addLinguisticTerm (const std::shared_ptr< FuzzySet > &linguisticTerm) |
Adds a new linguistic term to the LinguisticVariable. | |
std::shared_ptr< FuzzySet > | operator== (const std::string &linguisticTerm) const |
Overload of the operator== where the left-hand side is a linguistic variable, and the right-hand side is a linguistic term. | |
const std::string & | getName () const |
Getter for the name of the LinguisticVariable. | |
operator std::string () const | |
Returns a string representation of the LinguisticVariable. | |
A class representing a LinguisticVariable.
A LinguisticVariable is defined on a CrispSet and consists of several FuzzySets, which are the linguistic terms of the LinguisticVariable.
|
explicit |
Constructs a LinguisticVariable with the given name and range.
name | The name of the LinguisticVariable. |
range | The range of the LinguisticVariable in the form [min, max]. |
void autopas::FuzzyLogic::LinguisticVariable::addLinguisticTerm | ( | const std::shared_ptr< FuzzySet > & | linguisticTerm | ) |
Adds a new linguistic term to the LinguisticVariable.
Additionally updates the CrispSet of the linguistic term to the current CrispSet.
linguisticTerm | The linguistic term to add. |
const std::string & autopas::FuzzyLogic::LinguisticVariable::getName | ( | ) | const |
Getter for the name of the LinguisticVariable.
std::shared_ptr< FuzzySet > autopas::FuzzyLogic::LinguisticVariable::operator== | ( | const std::string & | linguisticTerm | ) | const |
Overload of the operator== where the left-hand side is a linguistic variable, and the right-hand side is a linguistic term.
Returns the fuzzy set corresponding to a linguistic term. This allows a very concise syntax to create fuzzy rules.
linguisticTerm | The name of the linguistic term to extract. |