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

Used to represent a Fuzzy Control System. More...

#include <FuzzyControlSystem.h>

Public Member Functions

 FuzzyControlSystem (std::shared_ptr< FuzzyControlSettings > settings)
 Constructs an empty FuzzyControlSystem with the given settings.
 
void addRule (const FuzzyRule &rule)
 Adds a new FuzzyRule to the FuzzyControlSystem.
 
std::shared_ptr< FuzzySetapplyRules (const FuzzySet::Data &data) const
 Applies all the rules of the FuzzyControlSystem with the given data and calculates the union of all the cut-consequents.
 
double predict (const FuzzySet::Data &data, size_t numSamples=1000) const
 Predicts the output of the FuzzyControlSystem for the given data.
 
 operator std::string () const
 Returns a string representation of the FuzzyControlSystem.
 

Detailed Description

Used to represent a Fuzzy Control System.

A Fuzzy Control System is a collection of FuzzyRules that can be applied to a given input to predict an output.

Constructor & Destructor Documentation

◆ FuzzyControlSystem()

autopas::FuzzyLogic::FuzzyControlSystem::FuzzyControlSystem ( std::shared_ptr< FuzzyControlSettings settings)
explicit

Constructs an empty FuzzyControlSystem with the given settings.

Parameters
settingsThe settings of the FuzzyControlSystem.

Member Function Documentation

◆ addRule()

void autopas::FuzzyLogic::FuzzyControlSystem::addRule ( const FuzzyRule rule)

Adds a new FuzzyRule to the FuzzyControlSystem.

Parameters
ruleThe FuzzyRule to add.

Additionally, the method checks if all the consequents of the FuzzyControlSystem have the same domain. Otherwise, an exception is thrown.

◆ applyRules()

std::shared_ptr< FuzzySet > autopas::FuzzyLogic::FuzzyControlSystem::applyRules ( const FuzzySet::Data data) const

Applies all the rules of the FuzzyControlSystem with the given data and calculates the union of all the cut-consequents.

Parameters
dataA map of the form {dimension_name: value}.
Returns
The FuzzySet resulting from the application of the FuzzyControlSystem to the given data.

◆ predict()

double autopas::FuzzyLogic::FuzzyControlSystem::predict ( const FuzzySet::Data data,
size_t  numSamples = 1000 
) const

Predicts the output of the FuzzyControlSystem for the given data.

Parameters
dataA map of the form {dimension_name: value}.
numSamplesThe number of samples to use for the numerical defuzzification. Default is 1000.
Returns
The predicted output of the FuzzyControlSystem for the given data.

This method performs the full prediction process of the FuzzyControlSystem. It first applies all the rules of the FuzzyControlSystem to the data and unites all the cut-consequents. The resulting FuzzySet is then defuzzified and the calculated value is returned.

The method reads the "defuzzificationMethod" and "numSamples" settings from the provided settings and performs the defuzzification accordingly.


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