A fuzzy logic C++ library
|
Rule defined as linguistic terms, see Handling rules for usage. More...
#include <rule.hpp>
Public Member Functions | |
RULE (EN_FIS_TYPE rt=TYPE_MAMDANI, EN_RULE_OP op=OPR_AND) | |
RULE (EN_RULE_OP op, EN_FIS_TYPE rt=TYPE_MAMDANI, std::string outvalue="") | |
RULE (EN_RULE_OP op, std::string outvalue, EN_FIS_TYPE rt=TYPE_MAMDANI) | |
void | ClearConditions () |
void | AddCondition (std::string input, std::string value) |
Add condition term to the rule. | |
void | SetConsequence (std::string output_value) |
Set the consequence of the rule (Mamdani inference system type) | |
size_t | GetNbTerms () const |
std::string | GetVarName (size_t idx) const |
std::string | GetVarValue (size_t idx) const |
std::string | GetVarValue (std::string input_name) const |
std::string | GetOutputValue () const |
void | Print (FILE *f, const char *msg=0) const |
Private Member Functions | |
int | P_FindVar (const std::string &input_name) const |
Searches terms for input input_name , returns its index if found or -1 if not. | |
Private Attributes | |
std::vector< RULE_TERM > | _v_terms |
std::string | _OutputValue |
bool | _HasOutputValue |
Rule defined as linguistic terms, see Handling rules for usage.
Inherits from ROOT_RULE, so can handle TS or Mamdani rules
slifis::RULE::RULE | ( | EN_FIS_TYPE | rt = TYPE_MAMDANI , |
EN_RULE_OP | op = OPR_AND |
||
) | [inline] |
slifis::RULE::RULE | ( | EN_RULE_OP | op, |
EN_FIS_TYPE | rt = TYPE_MAMDANI , |
||
std::string | outvalue = "" |
||
) | [inline] |
slifis::RULE::RULE | ( | EN_RULE_OP | op, |
std::string | outvalue, | ||
EN_FIS_TYPE | rt = TYPE_MAMDANI |
||
) | [inline] |
void slifis::RULE::ClearConditions | ( | ) |
void slifis::RULE::AddCondition | ( | std::string | input_name, |
std::string | input_value | ||
) |
void slifis::RULE::SetConsequence | ( | std::string | output_value | ) |
size_t slifis::RULE::GetNbTerms | ( | ) | const [inline] |
References _v_terms.
Referenced by slifis::SLIFIS::AddRule().
std::string slifis::RULE::GetVarName | ( | size_t | idx | ) | const |
References __IN__, __OUT__, slifis::ERR_RULE_BAD_INDEX, and SLIFIS_ERROR_2.
Referenced by slifis::SLIFIS::AddRule().
std::string slifis::RULE::GetVarValue | ( | size_t | idx | ) | const |
References __IN__, __OUT__, slifis::ERR_RULE_BAD_INDEX, and SLIFIS_ERROR_2.
Referenced by slifis::SLIFIS::AddRule().
std::string slifis::RULE::GetVarValue | ( | std::string | input_name | ) | const |
References __IN__, __OUT__, slifis::ERR_RULE_NAME_NOT_FOUND, and SLIFIS_ERROR_2.
std::string slifis::RULE::GetOutputValue | ( | ) | const |
References __IN__, __OUT__, slifis::ERR_RULE_NO_OUTPUT_VAL, SLIFIS_ERROR, and slifis::TYPE_MAMDANI.
Referenced by slifis::SLIFIS::AddRule().
void slifis::RULE::Print | ( | FILE * | f, |
const char * | msg = 0 |
||
) | const |
References slifis::OPR_AND, slifis::OPR_OR, SWITCH_ERROR, and slifis::TYPE_MAMDANI.
int slifis::RULE::P_FindVar | ( | const std::string & | input_name | ) | const [private] |
Searches terms for input input_name
, returns its index if found or -1 if not.
std::vector<RULE_TERM> slifis::RULE::_v_terms [private] |
Referenced by GetNbTerms().
std::string slifis::RULE::_OutputValue [private] |
bool slifis::RULE::_HasOutputValue [private] |