/usr/include/fl/Engine.h is in libfuzzylite-dev 5.1+dfsg-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | /*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzyliteâ„¢ is a trademark of FuzzyLite Limited.
*/
#ifndef FL_ENGINE_H
#define FL_ENGINE_H
#include "fl/fuzzylite.h"
#include "fl/defuzzifier/IntegralDefuzzifier.h"
#include <string>
#include <vector>
namespace fl {
class InputVariable;
class OutputVariable;
class Variable;
class RuleBlock;
class Hedge;
class TNorm;
class SNorm;
class Defuzzifier;
class FL_API Engine {
private:
void copyFrom(const Engine& source);
protected:
std::string _name;
std::vector<InputVariable*> _inputVariables;
std::vector<OutputVariable*> _outputVariables;
std::vector<RuleBlock*> _ruleblocks;
void updateReferences() const;
public:
explicit Engine(const std::string& name = "");
Engine(const Engine& other);
Engine& operator=(const Engine& other);
virtual ~Engine();
FL_DEFAULT_MOVE(Engine)
//TODO: remove int resolution in v6.0
virtual void configure(const std::string& conjunctionT,
const std::string& disjunctionS,
const std::string& activationT,
const std::string& accumulationS,
const std::string& defuzzifier,
int resolution = IntegralDefuzzifier::defaultResolution());
virtual void configure(TNorm* conjunction, SNorm* disjunction,
TNorm* activation, SNorm* accumulation,
Defuzzifier* defuzzifier);
virtual bool isReady(std::string* status = fl::null) const;
virtual void process();
virtual void restart();
virtual void setName(const std::string& name);
virtual std::string getName() const;
virtual void setInputValue(const std::string& name, scalar value);
virtual scalar getOutputValue(const std::string& name);
virtual std::string toString() const;
enum Type {
Mamdani, Larsen, TakagiSugeno,
Tsukamoto, InverseTsukamoto, Hybrid, Unknown
};
virtual Type type(std::string* name = fl::null, std::string* reason = fl::null) const;
virtual Engine* clone() const;
virtual std::vector<Variable*> variables() const;
/**
* Operations for iterable datatype _inputVariables
*/
virtual void addInputVariable(InputVariable* inputVariable);
virtual InputVariable* setInputVariable(InputVariable* inputVariable, int index);
virtual void insertInputVariable(InputVariable* inputVariable, int index);
virtual InputVariable* getInputVariable(int index) const;
virtual InputVariable* getInputVariable(const std::string& name) const;
virtual InputVariable* removeInputVariable(int index);
virtual InputVariable* removeInputVariable(const std::string& name);
virtual bool hasInputVariable(const std::string& name) const;
virtual int numberOfInputVariables() const;
virtual const std::vector<InputVariable*>& inputVariables() const;
virtual void setInputVariables(const std::vector<InputVariable*>& inputVariables);
virtual std::vector<InputVariable*>& inputVariables();
/**
* Operations for iterable datatype _outputVariables
*/
virtual void addOutputVariable(OutputVariable* outputVariable);
virtual OutputVariable* setOutputVariable(OutputVariable* outputVariable, int index);
virtual void insertOutputVariable(OutputVariable* outputVariable, int index);
virtual OutputVariable* getOutputVariable(int index) const;
virtual OutputVariable* getOutputVariable(const std::string& name) const;
virtual bool hasOutputVariable(const std::string& name) const;
virtual OutputVariable* removeOutputVariable(int index);
virtual OutputVariable* removeOutputVariable(const std::string& name);
virtual int numberOfOutputVariables() const;
virtual const std::vector<OutputVariable*>& outputVariables() const;
virtual void setOutputVariables(const std::vector<OutputVariable*>& outputVariables);
virtual std::vector<OutputVariable*>& outputVariables();
/**
* Operations for iterable datatype _ruleblocks
*/
virtual void addRuleBlock(RuleBlock* ruleblock);
virtual RuleBlock* setRuleBlock(RuleBlock* ruleBlock, int index);
virtual void insertRuleBlock(RuleBlock* ruleblock, int index);
virtual RuleBlock* getRuleBlock(int index) const;
virtual RuleBlock* getRuleBlock(const std::string& name) const;
virtual bool hasRuleBlock(const std::string& name) const;
virtual RuleBlock* removeRuleBlock(int index);
virtual RuleBlock* removeRuleBlock(const std::string& name);
virtual int numberOfRuleBlocks() const;
virtual const std::vector<RuleBlock*>& ruleBlocks() const;
virtual void setRuleBlocks(const std::vector<RuleBlock*>& ruleBlocks);
virtual std::vector<RuleBlock*>& ruleBlocks();
};
}
#endif /* FL_ENGINE_H */
|