InferenceMachine Class Reference

An inference machine. More...

#include <InferenceMachine.h>

Inheritance diagram for InferenceMachine:

CustomIM MamdaniIM SugenoIM

List of all members.

Public Types

typedef std::vector< RCPtr
< FuzzySet > > 
OutputType
typedef std::vector< double > InputType

Public Member Functions

 InferenceMachine (RuleBase *const rb=NULL)
 Constructor.
virtual ~InferenceMachine ()
 Destructor.
virtual OutputType computeInference (const InputType it) const
 Computes the inference.
virtual OutputType computeInference (double a) const
 Computes the inference.
virtual OutputType computeInference (double a, double b) const
 Computes the inference.
virtual OutputType computeInference (double a, double b, double c) const
 Computes the inference.
virtual OutputType computeInference (double a, double b, double c, double d) const
 Computes the inference.
void setRuleBase (RuleBase *const rB)
 Set the associated rule base.
void characteristicCurve (const std::string fileName="curve.dat", long int resolution=50) const
 Plots the defuzzification results for the whole input range into a gnuplot-suited file.

Protected Member Functions

virtual OutputType buildTreeFast (RuleBase::BaseIterator &actual, unsigned int remainingRules, int conclusionNumber, const InputType in) const =0

Protected Attributes

RuleBaseruleBasePtr


Detailed Description

An inference machine.

A virtual basis class for the different inference machines.

Definition at line 30 of file InferenceMachine.h.


Member Typedef Documentation

typedef std::vector<double> InferenceMachine::InputType

Definition at line 33 of file InferenceMachine.h.

typedef std::vector< RCPtr<FuzzySet> > InferenceMachine::OutputType

Definition at line 32 of file InferenceMachine.h.


Constructor & Destructor Documentation

InferenceMachine::InferenceMachine ( RuleBase *const  rb = NULL  ) 

Constructor.

Parameters:
rb the associated rulebase.

Definition at line 23 of file InferenceMachine.cpp.

InferenceMachine::~InferenceMachine (  )  [virtual]

Destructor.

Definition at line 43 of file InferenceMachine.cpp.


Member Function Documentation

virtual OutputType InferenceMachine::buildTreeFast ( RuleBase::BaseIterator actual,
unsigned int  remainingRules,
int  conclusionNumber,
const InputType  in 
) const [protected, pure virtual]

Referenced by computeInference().

void InferenceMachine::characteristicCurve ( const std::string  fileName = "curve.dat",
long int  resolution = 50 
) const

Plots the defuzzification results for the whole input range into a gnuplot-suited file.

For evaluation the borders of the linguistic variables are taken into consideration.

Parameters:
fileName name of the file where the data of characteristic curve is saved
resolution the resolution of the characterestic curve

Definition at line 90 of file InferenceMachine.cpp.

References RuleBase::getFirstFormatIterator(), RuleBase::getNumberOfInputs(), and ruleBasePtr.

InferenceMachine::OutputType InferenceMachine::computeInference ( double  a,
double  b,
double  c,
double  d 
) const [virtual]

Computes the inference.

Parameters:
a first crisp value
b second crisp value
c thrid crisp value
d forth crisp value
Returns:
a vector of fuzzy sets

Definition at line 68 of file InferenceMachine.cpp.

References computeInference().

InferenceMachine::OutputType InferenceMachine::computeInference ( double  a,
double  b,
double  c 
) const [virtual]

Computes the inference.

Parameters:
a first crisp value
b second crisp value
c thrid crisp value
Returns:
a vector of fuzzy sets

Definition at line 60 of file InferenceMachine.cpp.

References computeInference().

InferenceMachine::OutputType InferenceMachine::computeInference ( double  a,
double  b 
) const [virtual]

Computes the inference.

Parameters:
a first crisp value
b second crisp value
Returns:
a vector of fuzzy sets

Definition at line 53 of file InferenceMachine.cpp.

References computeInference().

InferenceMachine::OutputType InferenceMachine::computeInference ( double  a  )  const [virtual]

Computes the inference.

Parameters:
a a crisp value
Returns:
a vector of fuzzy sets

Definition at line 47 of file InferenceMachine.cpp.

References computeInference().

InferenceMachine::OutputType InferenceMachine::computeInference ( const InputType  it  )  const [virtual]

Computes the inference.

Parameters:
it a vector of crisp values (an InputType)
Returns:
a vector of fuzzy sets

Definition at line 25 of file InferenceMachine.cpp.

References buildTreeFast(), RuleBase::getFirstConclIt(), RuleBase::getFirstIterator(), RuleBase::getLastConclIt(), RuleBase::getNumberOfRules(), ComposedFS::MIN, and ruleBasePtr.

Referenced by computeInference().

void InferenceMachine::setRuleBase ( RuleBase *const   rB  )  [inline]

Set the associated rule base.

Parameters:
rB the rule base

Definition at line 123 of file InferenceMachine.h.

References ruleBasePtr.


Member Data Documentation

Definition at line 113 of file InferenceMachine.h.

Referenced by characteristicCurve(), computeInference(), and setRuleBase().


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