AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
autopas::FuzzyLogic::LinguisticVariable Class Reference

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< FuzzySetoperator== (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LinguisticVariable()

autopas::FuzzyLogic::LinguisticVariable::LinguisticVariable ( const std::string &  name,
std::pair< double, double >  range 
)
explicit

Constructs a LinguisticVariable with the given name and range.

Parameters
nameThe name of the LinguisticVariable.
rangeThe range of the LinguisticVariable in the form [min, max].

Member Function Documentation

◆ addLinguisticTerm()

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.

Parameters
linguisticTermThe linguistic term to add.

◆ getName()

const std::string & autopas::FuzzyLogic::LinguisticVariable::getName ( ) const

Getter for the name of the LinguisticVariable.

Returns
The name of the LinguisticVariable.

◆ operator==()

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.

Parameters
linguisticTermThe name of the linguistic term to extract.
Returns
The FuzzySet with the given name.

The documentation for this class was generated from the following files: