fuzzylite  6.0
A Fuzzy Logic Control Library in C++
fl::RuleBlock Class Reference

The RuleBlock class contains a set of Rules and fuzzy logic operators required to control an Engine. More...

#include <RuleBlock.h>

Collaboration diagram for fl::RuleBlock:

Public Member Functions

 RuleBlock (const std::string &name="")
 
 RuleBlock (const RuleBlock &other)
 
RuleBlockoperator= (const RuleBlock &other)
 
virtual ~RuleBlock ()
 
virtual void setEnabled (bool enabled)
 Enables the rule block. More...
 
virtual bool isEnabled () const
 Indicates whether the rule block is enabled. More...
 
virtual void activate ()
 Activates the rule block. More...
 
virtual void setName (std::string name)
 Sets the name of the rule block. More...
 
virtual std::string getName () const
 Gets the name of the rule block. More...
 
virtual std::string getDescription () const
 Gets the description of the rule block. More...
 
virtual void setDescription (const std::string &description)
 Sets the description of the rule block. More...
 
virtual void setConjunction (TNorm *conjunction)
 Sets the conjunction operator. More...
 
virtual TNormgetConjunction () const
 Gets the conjunction operator. More...
 
virtual void setDisjunction (SNorm *disjunction)
 Sets the disjunction operator. More...
 
virtual SNormgetDisjunction () const
 Gets the disjunction operator. More...
 
virtual void setImplication (TNorm *implication)
 Sets the implication operator. More...
 
virtual TNormgetImplication () const
 Gets the implication operator. More...
 
virtual void setActivation (Activation *activation)
 Sets the activation method. More...
 
virtual ActivationgetActivation () const
 Gets the activation method. More...
 
virtual void unloadRules () const
 Unloads all the rules in the rule block. More...
 
virtual void loadRules (const Engine *engine)
 Loads all the rules into the rule block. More...
 
virtual void reloadRules (const Engine *engine)
 Unloads all the rules in the rule block and then loads each rule again. More...
 
virtual std::string toString () const
 Returns a string representation of the rule block in the FuzzyLite Language. More...
 
virtual Complexity complexity () const
 Returns the estimated complexity of activating the rule block. More...
 
virtual void addRule (Rule *rule)
 Adds the given rule to the rule block. More...
 
virtual void insertRule (Rule *rule, std::size_t index)
 Inserts the rule at the specified index, shifting other rules to the right. More...
 
virtual RulegetRule (std::size_t index) const
 Gets the rule at the specified index. More...
 
virtual RuleremoveRule (std::size_t index)
 Removes the rule at the specified index. More...
 
virtual std::size_t numberOfRules () const
 Returns the number of rules added to the rule block. More...
 
virtual void setRules (const std::vector< Rule *> &rules)
 Sets the rules of the rule block. More...
 
virtual const std::vector< Rule * > & rules () const
 Returns an immutable vector of the rules added to the rule block. More...
 
virtual std::vector< Rule * > & rules ()
 Returns a mutable vector of the rules added to the rule block. More...
 
virtual RuleBlockclone () const
 Creates a clone of the rule block without the rules being loaded. More...
 

Detailed Description

The RuleBlock class contains a set of Rules and fuzzy logic operators required to control an Engine.

Author
Juan Rada-Vilela, Ph.D.
See also
Engine
Rule
Antecedent
Consequent
Since
4.0

Definition at line 47 of file RuleBlock.h.

Constructor & Destructor Documentation

◆ RuleBlock() [1/2]

fl::RuleBlock::RuleBlock ( const std::string &  name = "")
explicit

◆ RuleBlock() [2/2]

fl::RuleBlock::RuleBlock ( const RuleBlock other)

◆ ~RuleBlock()

virtual fl::RuleBlock::~RuleBlock ( )
virtual

Member Function Documentation

◆ activate()

virtual void fl::RuleBlock::activate ( )
virtual

Activates the rule block.

◆ addRule()

virtual void fl::RuleBlock::addRule ( Rule rule)
virtual

Adds the given rule to the rule block.

Parameters
ruleis the rule to add

◆ clone()

virtual RuleBlock* fl::RuleBlock::clone ( ) const
virtual

Creates a clone of the rule block without the rules being loaded.

Returns
a clone of the rule block without the rules being loaded

◆ complexity()

virtual Complexity fl::RuleBlock::complexity ( ) const
virtual

Returns the estimated complexity of activating the rule block.

Returns
the estimated complexity of activating the rule block

◆ getActivation()

virtual Activation* fl::RuleBlock::getActivation ( ) const
virtual

Gets the activation method.

Returns
the activation method

◆ getConjunction()

virtual TNorm* fl::RuleBlock::getConjunction ( ) const
virtual

Gets the conjunction operator.

Returns
the conjunction operator

◆ getDescription()

virtual std::string fl::RuleBlock::getDescription ( ) const
virtual

Gets the description of the rule block.

Returns
the description of the rule block

◆ getDisjunction()

virtual SNorm* fl::RuleBlock::getDisjunction ( ) const
virtual

Gets the disjunction operator.

Returns
the disjunction operator

◆ getImplication()

virtual TNorm* fl::RuleBlock::getImplication ( ) const
virtual

Gets the implication operator.

Returns
the implication operator

◆ getName()

virtual std::string fl::RuleBlock::getName ( ) const
virtual

Gets the name of the rule block.

Returns
the name of the rule block

◆ getRule()

virtual Rule* fl::RuleBlock::getRule ( std::size_t  index) const
virtual

Gets the rule at the specified index.

Parameters
indexis the index at which the rule is retrieved
Returns
the rule at the specified index

◆ insertRule()

virtual void fl::RuleBlock::insertRule ( Rule rule,
std::size_t  index 
)
virtual

Inserts the rule at the specified index, shifting other rules to the right.

Parameters
ruleis the rule to insert
indexis the index at which to insert the rule

◆ isEnabled()

virtual bool fl::RuleBlock::isEnabled ( ) const
virtual

Indicates whether the rule block is enabled.

Returns
whether the rule block is enabled

◆ loadRules()

virtual void fl::RuleBlock::loadRules ( const Engine engine)
virtual

Loads all the rules into the rule block.

Parameters
engineis the engine where this rule block is registered

◆ numberOfRules()

virtual std::size_t fl::RuleBlock::numberOfRules ( ) const
virtual

Returns the number of rules added to the rule block.

Returns
the number of rules added to the rule block

◆ operator=()

RuleBlock& fl::RuleBlock::operator= ( const RuleBlock other)

◆ reloadRules()

virtual void fl::RuleBlock::reloadRules ( const Engine engine)
virtual

Unloads all the rules in the rule block and then loads each rule again.

Parameters
engineis the engine where this rule block is registered

◆ removeRule()

virtual Rule* fl::RuleBlock::removeRule ( std::size_t  index)
virtual

Removes the rule at the specified index.

Parameters
indexis the index at which the rule will be removed, shifting other rules to the left
Returns
the rule at the specified index

◆ rules() [1/2]

virtual const std::vector<Rule*>& fl::RuleBlock::rules ( ) const
virtual

Returns an immutable vector of the rules added to the rule block.

Returns
an immutable vector of the rules added to the rule block

◆ rules() [2/2]

virtual std::vector<Rule*>& fl::RuleBlock::rules ( )
virtual

Returns a mutable vector of the rules added to the rule block.

Returns
a mutable vector of the rules added to the rule block

◆ setActivation()

virtual void fl::RuleBlock::setActivation ( Activation activation)
virtual

Sets the activation method.

Parameters
activationis the activation method

◆ setConjunction()

virtual void fl::RuleBlock::setConjunction ( TNorm conjunction)
virtual

Sets the conjunction operator.

Parameters
conjunctionis the conjunction operator

◆ setDescription()

virtual void fl::RuleBlock::setDescription ( const std::string &  description)
virtual

Sets the description of the rule block.

Parameters
descriptionis the description of the rule block

◆ setDisjunction()

virtual void fl::RuleBlock::setDisjunction ( SNorm disjunction)
virtual

Sets the disjunction operator.

Parameters
disjunctionis the disjunction operator

◆ setEnabled()

virtual void fl::RuleBlock::setEnabled ( bool  enabled)
virtual

Enables the rule block.

Parameters
enabledwhether the rule block is enabled

◆ setImplication()

virtual void fl::RuleBlock::setImplication ( TNorm implication)
virtual

Sets the implication operator.

Parameters
implicationis the implication operator

◆ setName()

virtual void fl::RuleBlock::setName ( std::string  name)
virtual

Sets the name of the rule block.

Parameters
nameis the name of the rule block

◆ setRules()

virtual void fl::RuleBlock::setRules ( const std::vector< Rule *> &  rules)
virtual

Sets the rules of the rule block.

Parameters
rulesis a vector of rules

◆ toString()

virtual std::string fl::RuleBlock::toString ( ) const
virtual

Returns a string representation of the rule block in the FuzzyLite Language.

Returns
a string representation of the rule block in the FuzzyLite Language

◆ unloadRules()

virtual void fl::RuleBlock::unloadRules ( ) const
virtual

Unloads all the rules in the rule block.


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