A fuzzy logic C++ library
|
Set of input membership functions. More...
#include <fuzzy_in.hpp>
Public Member Functions | |
FUZZY_IN (std::string n="-unnamed-") | |
FUZZY_IN (std::string n, const std::vector< REALVAL > &v_mf) | |
Constructor used for building automatically a set of triangular functions partitioning input space, using the given values in v. | |
FUZZY_IN (std::string n, REALVAL vmin, REALVAL vmax, size_t NbFunc=2, EN_FUNCSPACING s=FS_LIN) | |
Constructor used for building automatically a set of triangular functions partitioning input space into Nb functions, going from vmin to vmax , regularly spaced. | |
~FUZZY_IN () | |
void | SetInputValue (REALVAL v) |
REALVAL | GetInputValue () const |
FUZZYVAL | GetFuzzyValue (size_t idx_mf) const |
Returns fuzzyfied input value, using the membership function of index idx_mf . | |
std::vector< FUZZYVAL > | GetInputFiringStrength () const |
Returns a vector giving for each membership function in the set, how much ([0-1]) the input value (FUZZY_IN::_InputValue) triggers it. | |
bool | operator== (const FUZZY_IN &m) const |
Equality operator. Returns true if all the contained membership functions are equal. | |
bool | operator!= (const FUZZY_IN &m) const |
bool | SetIsValid () const |
Return true if the set of functions is valid (call root class method) | |
Private Attributes | |
REALVAL | _InputValue |
Value of the parameter that is been fuzzyfied. |
Set of input membership functions.
Inherited from FUZZY_ROOT, only adds an input value. See Sets of membership functions for a description of differences between FUZZY_IN and FUZZY_OUT
slifis::FUZZY_IN::FUZZY_IN | ( | std::string | n = "-unnamed-" | ) |
slifis::FUZZY_IN::FUZZY_IN | ( | std::string | n, |
const std::vector< REALVAL > & | v0 | ||
) |
Constructor used for building automatically a set of triangular functions partitioning input space, using the given values in v.
See FUZZY_ROOT constructor
References slifis::FUZZY_ROOT::SetNormalisedSet().
slifis::FUZZY_IN::FUZZY_IN | ( | std::string | n, |
REALVAL | vmin, | ||
REALVAL | vmax, | ||
size_t | NbFunc = 2 , |
||
EN_FUNCSPACING | spacing = FS_LIN |
||
) |
Constructor used for building automatically a set of triangular functions partitioning input space into Nb
functions, going from vmin
to vmax
, regularly spaced.
See FUZZY_ROOT constructor
n | set name |
vmin | minimum value |
vmax | Max value |
NbFunc | Nb of functions, between 2 to ??? |
spacing | functions spacing |
References slifis::FUZZY_ROOT::SetNormalisedSet().
void slifis::FUZZY_IN::SetInputValue | ( | REALVAL | v | ) | [inline] |
References _InputValue.
REALVAL slifis::FUZZY_IN::GetInputValue | ( | ) | const [inline] |
References _InputValue.
Referenced by slifis::RULE_IDX::GetRuleFiringStrength(), slifis::ROOT_RULE::GetTSOutputValue(), and slifis::SLIFIS::P_Evaluate_M().
FUZZYVAL slifis::FUZZY_IN::GetFuzzyValue | ( | size_t | idx_mf | ) | const |
Returns fuzzyfied input value, using the membership function of index idx_mf
.
References __IN__, __OUT__, _InputValue, slifis::ERR_MF_BAD_INDEX, slifis::MEMBFUNC::Fuzzify(), slifis::FUZZY_ROOT::GetMf(), slifis::FUZZY_ROOT::GetNbMf(), and SLIFIS_ERROR_2.
std::vector< FUZZYVAL > slifis::FUZZY_IN::GetInputFiringStrength | ( | ) | const |
Returns a vector giving for each membership function in the set, how much ([0-1]) the input value (FUZZY_IN::_InputValue) triggers it.
References __IN__, __OUT__, _InputValue, slifis::MEMBFUNC::Fuzzify(), slifis::FUZZY_ROOT::GetMf(), and slifis::FUZZY_ROOT::GetNbMf().
Referenced by slifis_plot::GetFiringStrengthVector().
bool slifis::FUZZY_IN::operator== | ( | const FUZZY_IN & | f2 | ) | const |
Equality operator. Returns true if all the contained membership functions are equal.
At present, calls the equality operator of inherited class FUZZY_ROOT
bool slifis::FUZZY_IN::operator!= | ( | const FUZZY_IN & | m | ) | const [inline] |
bool slifis::FUZZY_IN::SetIsValid | ( | ) | const [inline, virtual] |
Return true if the set of functions is valid (call root class method)
Implements slifis::FUZZY_ROOT.
References slifis::FUZZY_ROOT::P_SetIsValid().
REALVAL slifis::FUZZY_IN::_InputValue [private] |
Value of the parameter that is been fuzzyfied.
Referenced by GetFuzzyValue(), GetInputFiringStrength(), GetInputValue(), and SetInputValue().