AutoPas  3.0.0
Loading...
Searching...
No Matches
FuzzyControlSystem.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <memory>
10#include <vector>
11
12#include "FuzzyRule.h"
13#include "FuzzySet.h"
14
15namespace autopas::FuzzyLogic {
16
21using FuzzyControlSettings = std::map<std::string, std::string>;
22
28 public:
33 explicit FuzzyControlSystem(std::shared_ptr<FuzzyControlSettings> settings);
34
42 void addRule(const FuzzyRule &rule);
43
50 [[nodiscard]] std::shared_ptr<FuzzySet> applyRules(const FuzzySet::Data &data) const;
51
65 [[nodiscard]] double predict(const FuzzySet::Data &data, size_t numSamples = 1000) const;
66
70 explicit operator std::string() const;
71
72 private:
76 std::shared_ptr<FuzzyControlSettings> _settings;
77
81 std::vector<FuzzyRule> _rules;
82
86 std::optional<std::string> _outputDomain;
87};
88
89} // namespace autopas::FuzzyLogic
Used to represent a Fuzzy Control System.
Definition: FuzzyControlSystem.h:27
std::shared_ptr< FuzzySet > applyRules(const FuzzySet::Data &data) const
Applies all the rules of the FuzzyControlSystem with the given data and calculates the union of all t...
Definition: FuzzyControlSystem.cpp:33
double predict(const FuzzySet::Data &data, size_t numSamples=1000) const
Predicts the output of the FuzzyControlSystem for the given data.
Definition: FuzzyControlSystem.cpp:40
void addRule(const FuzzyRule &rule)
Adds a new FuzzyRule to the FuzzyControlSystem.
Definition: FuzzyControlSystem.cpp:17
Used to represent a Fuzzy Rule.
Definition: FuzzyRule.h:20
std::map< std::string, double > Data
A map of the form {dimension_name: value}.
Definition: FuzzySet.h:81
Namespace that contains the fuzzy logic framework used by the FuzzyTuning-strategy.
Definition: namespaces.h:112
std::map< std::string, std::string > FuzzyControlSettings
The settings of a FuzzyControlSystem are a map of key-value pairs.
Definition: FuzzyControlSystem.h:21