|
| OutputVariable (const std::string &name="", scalar minimum=-fl::inf, scalar maximum=fl::inf) |
|
| OutputVariable (const OutputVariable &other) |
|
OutputVariable & | operator= (const OutputVariable &other) |
|
virtual | ~OutputVariable () FL_IOVERRIDE |
|
virtual Aggregated * | fuzzyOutput () const |
| Gets the fuzzy output value \(\tilde{y}\). More...
|
|
virtual void | setName (const std::string &name) FL_IOVERRIDE |
| Sets the name of the variable. More...
|
|
virtual void | setMinimum (scalar minimum) FL_IOVERRIDE |
| Sets the minimum value of the range of the variable. More...
|
|
virtual void | setMaximum (scalar maximum) FL_IOVERRIDE |
| Sets the maximum value of the range of the variable. More...
|
|
virtual void | setDefuzzifier (Defuzzifier *defuzzifier) |
| Sets the defuzzifier of the output variable. More...
|
|
virtual Defuzzifier * | getDefuzzifier () const |
| Gets the defuzzifier of the output variable. More...
|
|
virtual void | setAggregation (SNorm *aggregation) |
| Sets the aggregation operator. More...
|
|
virtual SNorm * | getAggregation () const |
| Gets the aggregation operator. More...
|
|
virtual void | setPreviousValue (scalar previousValue) |
| Sets the previous value of the output variable. More...
|
|
virtual scalar | getPreviousValue () const |
| Gets the previous value of the output variable. More...
|
|
virtual void | setDefaultValue (scalar defaultValue) |
| Sets the default value of the output variable. More...
|
|
virtual scalar | getDefaultValue () const |
| Gets the default value of the output variable. More...
|
|
virtual void | setLockPreviousValue (bool lockPreviousValue) |
| Sets whether to lock the previous value of the output variable. More...
|
|
virtual bool | isLockPreviousValue () const |
| Gets whether to lock the previous value of the output variable. More...
|
|
virtual Complexity | complexity (const Activated &term) const |
| Computes the estimated complexity of defuzzifying the activated term with the current configuration of the variable (namely aggregation and defuzzifier. More...
|
|
virtual Complexity | complexityOfDefuzzification () const |
| Computes the estimated complexity of aggregating and defuzzifying all the terms in the variable. More...
|
|
virtual Complexity | currentComplexity () const |
| Computes the estimated complexity of aggregating and defuzzifying the terms currently found in the fuzzy output variable. More...
|
|
virtual void | defuzzify () |
| Defuzzifies the output variable and stores the output value and the previous output value. More...
|
|
virtual std::string | fuzzyOutputValue () const |
| Gets a string representation of the fuzzy output value \(\tilde{y}\). More...
|
|
virtual void | clear () |
| Clears the output variable by setting \(\tilde{y}=\{\}\), \(y^{t}=\mbox{NaN}\), \(y^{t-1}=\mbox{NaN}\). More...
|
|
virtual Variable::Type | type () const FL_IOVERRIDE |
| Returns the type of the variable. More...
|
|
virtual std::string | toString () const FL_IOVERRIDE |
| Gets a string representation of the variable in the FuzzyLite Language. More...
|
|
virtual OutputVariable * | clone () const FL_IOVERRIDE |
| Creates a clone of the variable. More...
|
|
| Variable (const std::string &name="", scalar minimum=-fl::inf, scalar maximum=fl::inf) |
|
| Variable (const Variable &other) |
|
Variable & | operator= (const Variable &other) |
|
virtual | ~Variable () |
|
virtual std::string | getName () const |
| Gets the name of the variable. More...
|
|
virtual std::string | getDescription () const |
| Gets the description of the variable. More...
|
|
virtual void | setDescription (const std::string &description) |
| Sets the description of the variable. More...
|
|
virtual void | setValue (scalar value) |
| Sets the value of the variable. More...
|
|
virtual scalar | getValue () const |
| Gets the value of the variable. More...
|
|
virtual void | setRange (scalar minimum, scalar maximum) |
| Sets the range of the variable between [minimum, maximum] More...
|
|
virtual scalar | range () const |
| Gets the magnitude of the range of the variable. More...
|
|
virtual scalar | getMinimum () const |
| Gets the minimum value of the range of the variable. More...
|
|
virtual scalar | getMaximum () const |
| Gets the maximum value of the range of the variable. More...
|
|
virtual void | setEnabled (bool enabled) |
| Sets whether the variable is enabled. More...
|
|
virtual bool | isEnabled () const |
| Gets whether the variable is enabled. More...
|
|
virtual void | setLockValueInRange (bool lockValueInRange) |
| Sets whether the variable locks the current value to the range of the variable. More...
|
|
virtual bool | isLockValueInRange () const |
| Gets whether the variable locks the current value to the range of the variable. More...
|
|
virtual Complexity | complexity () const |
| Computes the aggregated complexity of the underlying terms. More...
|
|
virtual std::string | fuzzify (scalar x) const |
| Evaluates the membership function of value \(x\) for each term \(i\), resulting in a fuzzy value in the form \(\tilde{x}=\sum_i{\mu_i(x)/i}\). More...
|
|
virtual Term * | highestMembership (scalar x, scalar *yhighest=fl::null) const |
| Gets the term which has the highest membership function value for \(x\). More...
|
|
virtual void | sort () |
| Sorts the terms in ascending order according to their centroids. More...
|
|
virtual void | addTerm (Term *term) |
| Adds a term to the variable. More...
|
|
virtual void | insertTerm (Term *term, std::size_t index) |
| Inserts the term in the variable. More...
|
|
virtual Term * | getTerm (std::size_t index) const |
| Gets the term at the given index. More...
|
|
virtual Term * | getTerm (const std::string &name) const |
| Gets the term of the given name. More...
|
|
virtual bool | hasTerm (const std::string &name) const |
| Gets whether a term of the given name has been added. More...
|
|
virtual Term * | removeTerm (std::size_t index) |
| Removes the term at the given index. More...
|
|
virtual std::size_t | numberOfTerms () const |
| Gets the number of terms added to the variable. More...
|
|
virtual void | setTerms (const std::vector< Term *> &terms) |
| Sets the terms of the variable. More...
|
|
virtual const std::vector< Term * > & | terms () const |
| Gets an immutable vector of the terms. More...
|
|
virtual std::vector< Term * > & | terms () |
| Gets a mutable vector of the terms. More...
|
|
The OutputVariable class is a Variable that represents an output of the fuzzy logic controller.
During the activation of a RuleBlock, the Activated terms of each Rule will be Aggregated in the OutputVariable::fuzzyOutput(), which represents a fuzzy set hereinafter referred to as \(\tilde{y}\). The defuzzification of \(\tilde{y}\) translates the fuzzy output value \(\tilde{y}\) into a crisp output value \(y\), which can be retrieved using Variable::getValue(). The value of the OutputVariable is computed and automatically stored when calling OutputVariable::defuzzify(), but the value depends on the following properties (expressed in the FuzzyLite Language):
- Property
default: scalar
overrides the output value \(y\) with the given fl::scalar whenever the defuzzification process results in a non-finite value (i.e., fl::nan and fl::inf). For example, considering default: 0.0
, if RuleBlock::activate() does not activate any rules whose Consequent contribute to the OutputVariable, then the fuzzy output value is empty, the Defuzzifier does not operate, and hence \(y=0.0\). By default, default: NaN
. Relevant methods are OutputVariable::getDefaultValue() and OutputVariable::setDefaultValue().
- Property
lock-previous: boolean
, if enabled, overrides the output value \(y^t\) at time \(t\) with the previously defuzzified valid output value \(y^{t-1}\) if defuzzification process results in a non-finite value (i.e., fl::nan and fl::inf). When enabled, the property takes precedence over default
if \(y^{t-1}\) is a finite value. By default, lock-previous: false
, \(y^{t-1}=\mbox{NaN}\) for \(t=0\), and \(y^{t-1}=\mbox{NaN}\) when OutputVariable::clear(). Relevant methods are OutputVariable::lockPreviousValue(), OutputVariable::isLockPreviousValue, OutputVariable::getPreviousValue(), and OutputVariable::setPreviousValue().
- Property
lock-range: boolean
overrides the output value \(y\) to enforce it lies within the range of the variable determined by Variable::getMinimum() and Variable::getMaximum(). When enabled, this property takes precedence over lock-previous
and default
. For example, considering range: -1.0 1.0
and lock-range: true
, \(y=-1.0\) if the result from the Defuzzifier is smaller than -1.0
, and \(y=1.0\) if the result from the Defuzzifier is greater than 1.0
. The property lock-range
was introduced in version 5.0 to substitute the property lock-valid
in version 4.0. By default, lock-range: false
. Relevant methods are Variable::lockValueInRange(), Variable::isLockValueInRange(), Variable::getMinimum(), and Variable::getMaximum()
- Author
- Juan Rada-Vilela, Ph.D.
- See also
- Variable
-
InputVariable
-
RuleBlock::activate()
-
Term
- Since
- 4.0
Definition at line 85 of file OutputVariable.h.