RuleBase Class Reference

A composite of rules. More...

#include <RuleBase.h>

List of all members.

Public Types

typedef std::list< RCPtr
< LinguisticVariable > > 
inputTemplate
typedef std::list< RCPtr
< LinguisticVariable > > 
outputTemplate
typedef RuleSet::const_iterator BaseIterator
typedef
inputTemplate::const_iterator 
FormatIterator
typedef
outputTemplate::const_iterator 
ConclIt

Public Member Functions

 RuleBase ()
 ~RuleBase ()
void addRule (const RCPtr< Rule > &rule)
 Add a rule to the rulebase.
void removeRule (const RCPtr< Rule > &rule)
 Remove a rule from the rulbase.
int getNumberOfRules ()
 Return the number of rules in the rulebase.
const std::string print () const
 Return a string with the all the rules of the rulabase.
const RCPtr< RulegetRule (int whichone)
 Return a certain rule of the rulebase.
BaseIterator getFirstIterator () const
BaseIterator getLastIterator () const
FormatIterator getFirstFormatIterator () const
FormatIterator getLastFormatIterator () const
FormatIterator getFirstConclIt () const
FormatIterator getLastConclIt () const
void setInputFormat (inputTemplate &in)
 Sets the Input Format.
void addToInputFormat (const RCPtr< LinguisticVariable > &lv)
 Adds a liniguistic variable to the Imput Format.
void addToInputFormat (const RCPtr< LinguisticVariable > &lv1, const RCPtr< LinguisticVariable > &lv2)
 Adds two liniguistic variables to the Imput Format.
void addToInputFormat (const RCPtr< LinguisticVariable > &lv1, const RCPtr< LinguisticVariable > &lv2, const RCPtr< LinguisticVariable > &lv3)
 Adds three liniguistic variables to the Imput Format.
void addToInputFormat (const RCPtr< LinguisticVariable > &lv1, const RCPtr< LinguisticVariable > &lv2, const RCPtr< LinguisticVariable > &lv3, const RCPtr< LinguisticVariable > &lv4)
 Adds four liniguistic variable to the Imput Format.
void addToOutputFormat (const RCPtr< LinguisticVariable > &lv)
 Adds a liniguistic variable to the Ouput Format.
void addToOutputFormat (const RCPtr< LinguisticVariable > &lv1, const RCPtr< LinguisticVariable > &lv2)
 Adds two liniguistic variables to the Ouput Format.
void removeFromInputFormat (const RCPtr< LinguisticVariable > &lv)
 Removes a liniguistic variable from the Imput Format.
unsigned int getNumberOfInputs () const
 Returns the number of linguistic variables in the Input Format.


Detailed Description

A composite of rules.

A rulebase combines several rules.

Definition at line 30 of file RuleBase.h.


Member Typedef Documentation

typedef RuleSet::const_iterator RuleBase::BaseIterator

Definition at line 80 of file RuleBase.h.

typedef outputTemplate::const_iterator RuleBase::ConclIt

Definition at line 98 of file RuleBase.h.

typedef inputTemplate::const_iterator RuleBase::FormatIterator

Definition at line 88 of file RuleBase.h.

Definition at line 37 of file RuleBase.h.

Definition at line 38 of file RuleBase.h.


Constructor & Destructor Documentation

RuleBase::RuleBase (  ) 

Definition at line 24 of file RuleBase.cpp.

RuleBase::~RuleBase (  ) 

Definition at line 16 of file RuleBase.cpp.


Member Function Documentation

void RuleBase::addRule ( const RCPtr< Rule > &  rule  ) 

Add a rule to the rulebase.

Parameters:
rule the rule to be added

Definition at line 28 of file RuleBase.cpp.

Referenced by build_rule_base_from_xml(), and Rule::Rule().

void RuleBase::addToInputFormat ( const RCPtr< LinguisticVariable > &  lv1,
const RCPtr< LinguisticVariable > &  lv2,
const RCPtr< LinguisticVariable > &  lv3,
const RCPtr< LinguisticVariable > &  lv4 
)

Adds four liniguistic variable to the Imput Format.

The linguistic variables must be added in the correct order with respect to the corresponding positions in the input vector.

Parameters:
lv1 the first linguistic variable to be added
lv2 the secound linguistic variable to be added
lv3 the third linguitic variable to be added
lv4 the fourth linguitic variable to be added

Definition at line 104 of file RuleBase.cpp.

References addToInputFormat().

void RuleBase::addToInputFormat ( const RCPtr< LinguisticVariable > &  lv1,
const RCPtr< LinguisticVariable > &  lv2,
const RCPtr< LinguisticVariable > &  lv3 
)

Adds three liniguistic variables to the Imput Format.

The linguistic variables must be added in the correct order with respect to the corresponding positions in the input vector.

Parameters:
lv1 the first linguistic variable to be added
lv2 the secound linguistic variable to be added
lv3 the third linguitic variable to be added

Definition at line 96 of file RuleBase.cpp.

References addToInputFormat().

void RuleBase::addToInputFormat ( const RCPtr< LinguisticVariable > &  lv1,
const RCPtr< LinguisticVariable > &  lv2 
)

Adds two liniguistic variables to the Imput Format.

The linguistic variables must be added in the correct order with respect to the corresponding positions in the input vector.

Parameters:
lv1 the first linguistic variable to be added
lv2 the secound linguistic variable to be added

Definition at line 90 of file RuleBase.cpp.

References addToInputFormat().

void RuleBase::addToInputFormat ( const RCPtr< LinguisticVariable > &  lv  ) 

Adds a liniguistic variable to the Imput Format.

The linguistic variables must be added in the correct order with respect to the corresponding positions in the input vector.

Parameters:
lv the linguistic variable to be added

Definition at line 60 of file RuleBase.cpp.

Referenced by addToInputFormat(), and build_rule_base_from_xml().

void RuleBase::addToOutputFormat ( const RCPtr< LinguisticVariable > &  lv1,
const RCPtr< LinguisticVariable > &  lv2 
)

Adds two liniguistic variables to the Ouput Format.

The linguistic variables must be added in the correct order with respect to the corresponding positions in the input vector.

Parameters:
lv1 the firs linguistic variable to be added
lv2 the secound linguistic variable to be added

Definition at line 115 of file RuleBase.cpp.

References addToOutputFormat().

void RuleBase::addToOutputFormat ( const RCPtr< LinguisticVariable > &  lv  ) 

Adds a liniguistic variable to the Ouput Format.

The linguistic variables must be added in the correct order with respect to the corresponding positions in the input vector.

Parameters:
lv the linguistic variable to be added

Definition at line 65 of file RuleBase.cpp.

Referenced by addToOutputFormat(), and build_rule_base_from_xml().

FormatIterator RuleBase::getFirstConclIt (  )  const [inline]

Definition at line 102 of file RuleBase.h.

Referenced by InferenceMachine::computeInference(), and save_rule_base_to_xml().

FormatIterator RuleBase::getFirstFormatIterator (  )  const [inline]

BaseIterator RuleBase::getFirstIterator (  )  const [inline]

Definition at line 82 of file RuleBase.h.

Referenced by InferenceMachine::computeInference(), and save_rule_base_to_xml().

FormatIterator RuleBase::getLastConclIt (  )  const [inline]

Definition at line 106 of file RuleBase.h.

Referenced by InferenceMachine::computeInference(), and save_rule_base_to_xml().

FormatIterator RuleBase::getLastFormatIterator (  )  const [inline]

Definition at line 96 of file RuleBase.h.

Referenced by save_rule_base_to_xml().

BaseIterator RuleBase::getLastIterator (  )  const [inline]

Definition at line 86 of file RuleBase.h.

Referenced by save_rule_base_to_xml().

unsigned int RuleBase::getNumberOfInputs (  )  const [inline]

Returns the number of linguistic variables in the Input Format.

@ return, the number of linguistic variables in the Input Format

Definition at line 206 of file RuleBase.h.

Referenced by SugenoRule::calculateConsequence(), InferenceMachine::characteristicCurve(), and SugenoRule::setConclusion().

int RuleBase::getNumberOfRules (  )  [inline]

Return the number of rules in the rulebase.

Definition at line 58 of file RuleBase.h.

Referenced by InferenceMachine::computeInference(), and getRule().

const RCPtr< Rule > RuleBase::getRule ( int  whichone  ) 

Return a certain rule of the rulebase.

Parameters:
whichone the number of the rule that shall be returned

Definition at line 46 of file RuleBase.cpp.

References getNumberOfRules().

const std::string RuleBase::print (  )  const

Return a string with the all the rules of the rulabase.

Returns:
, the rulebase as a string

Definition at line 77 of file RuleBase.cpp.

void RuleBase::removeFromInputFormat ( const RCPtr< LinguisticVariable > &  lv  ) 

Removes a liniguistic variable from the Imput Format.

Parameters:
lv the linguistic variable to be removed

Definition at line 69 of file RuleBase.cpp.

void RuleBase::removeRule ( const RCPtr< Rule > &  rule  ) 

Remove a rule from the rulbase.

Parameters:
rule the rule to be added

Definition at line 32 of file RuleBase.cpp.

void RuleBase::setInputFormat ( inputTemplate in  ) 

Sets the Input Format.

Parameters:
in the InputTemplate (list of linguistic vaiables)

Definition at line 73 of file RuleBase.cpp.


The documentation for this class was generated from the following files: