A fuzzy logic C++ library
Public Member Functions | Public Attributes | Private Attributes | Friends
slifis::RB_TABLE Class Reference

A rule base of 2 inputs, represented as a table (computed only when needed). Private class, do not use in your code! More...

#include <rb_table.hpp>

+ Collaboration diagram for slifis::RB_TABLE:

List of all members.

Public Member Functions

 RB_TABLE ()
bool Print (FILE *fp, const char *msg=0)
 Printing table.
bool Compute ()
 Export rule base in a "table" view (suited only for 2-inputs FIS).
void AssignRuleBase (const RULE_BASE *rule_base)
const FUZZY_INGetFuzzySet_row () const
const FUZZY_INGetFuzzySet_col () const
std::string GetOutputIndexString (size_t row, size_t col) const
 Return a string with all the output indexes used at (row, col)
std::string GetRuleIndexString (size_t row, size_t col) const
 Returns a string showing which rules target this cell.
bool HasSomethingHere (size_t row, size_t col) const
 Returns true if cell at (row, col) is concerned by a rule.
bool IsComputed () const

Public Attributes

size_t NbFunc_row
 Initialised when computing table.
size_t NbFunc_col
 Initialised when computing table.

Private Attributes

std::vector< std::vector
< std::vector< int > > > 
v_o
 holds a set of output MF index, one per cell
std::vector< std::vector
< std::vector< int > > > 
v_r
 holds a set of rule indexes, one per cell
bool _IsComputed
size_t _idx_col
 Index of input set of fis for horizontal axis of table.
size_t _idx_row
 Index of input set of fis for vertical axis of table.
const RULE_BASEp_rb
 pointer on original rule base

Friends

class RULE_BASE

Detailed Description

A rule base of 2 inputs, represented as a table (computed only when needed). Private class, do not use in your code!

Low Priority Todo:
Maybe this class should be moved to GAPI: it doesn't seem to be useful in main lib.

Constructor & Destructor Documentation


Member Function Documentation

bool slifis::RB_TABLE::Print ( FILE *  fp,
const char *  msg = 0 
)

Printing table.

References SLIFIS_WARNING.

Referenced by slifis::RULE_BASE::PrintTable().

void slifis::RB_TABLE::AssignRuleBase ( const RULE_BASE rule_base) [inline]

References p_rb.

Referenced by slifis::RULE_BASE::RULE_BASE().

std::string slifis::RB_TABLE::GetOutputIndexString ( size_t  row,
size_t  col 
) const

Return a string with all the output indexes used at (row, col)

Returns a string showing which output function the cell rules triggers.

Referenced by slifis_plot::PLOT_RB_2D::P_DrawIndexes().

std::string slifis::RB_TABLE::GetRuleIndexString ( size_t  row,
size_t  col 
) const

Returns a string showing which rules target this cell.

Referenced by slifis_plot::PLOT_RB_2D::P_DrawIndexes().

bool slifis::RB_TABLE::HasSomethingHere ( size_t  row,
size_t  col 
) const [inline]

Returns true if cell at (row, col) is concerned by a rule.

References v_o.

Referenced by slifis_plot::PLOT_RB_2D::P_DrawIndexes().

bool slifis::RB_TABLE::IsComputed ( ) const [inline]

References _IsComputed.

Referenced by slifis_plot::PLOT_RB_2D::Draw().


Friends And Related Function Documentation

friend class RULE_BASE [friend]

Member Data Documentation

Initialised when computing table.

Initialised when computing table.

std::vector< std::vector< std::vector<int> > > slifis::RB_TABLE::v_o [private]

holds a set of output MF index, one per cell

Referenced by HasSomethingHere().

std::vector< std::vector< std::vector<int> > > slifis::RB_TABLE::v_r [private]

holds a set of rule indexes, one per cell

size_t slifis::RB_TABLE::_idx_col [private]

Index of input set of fis for horizontal axis of table.

size_t slifis::RB_TABLE::_idx_row [private]

Index of input set of fis for vertical axis of table.

pointer on original rule base

Referenced by AssignRuleBase().