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

The Last class is a RuleBlock Activation method that activates the last \(n\) rules whose activation degrees are greater than or equal to the given threshold. More...

#include <Last.h>

Inheritance diagram for fl::Last:
Collaboration diagram for fl::Last:

Public Member Functions

 Last (int numberOfRules=1, scalar threshold=0.0)
 
virtual ~Last ()
 
virtual std::string className () const FL_IOVERRIDE
 Returns the name of the activation method, which is also utilized to register the activation method in the ActivationFactory. More...
 
virtual std::string parameters () const FL_IOVERRIDE
 Returns the number of rules and the threshold of the activation method. More...
 
virtual void configure (const std::string &parameters) FL_IOVERRIDE
 Configures the activation method with the given number of rules and threshold. More...
 
virtual void setNumberOfRules (int numberOfRules)
 Sets the number of rules for the activation degree. More...
 
virtual int getNumberOfRules () const
 Gets the number of rules for the activation degree. More...
 
virtual void setThreshold (scalar threshold)
 Sets the threshold for the activation degree. More...
 
virtual scalar getThreshold () const
 Gets the threshold for the activation degree. More...
 
virtual Complexity complexity (const RuleBlock *ruleBlock) const FL_IOVERRIDE
 Computes the estimated complexity of activating the given rule block. More...
 
virtual void activate (RuleBlock *ruleBlock) FL_IOVERRIDE
 Activates the last \(n\) rules whose activation degrees are greater than the given threshold. More...
 
virtual Lastclone () const FL_IOVERRIDE
 Clones the activation method. More...
 
- Public Member Functions inherited from fl::Activation
 Activation ()
 
virtual ~Activation ()
 

Static Public Member Functions

static Activationconstructor ()
 

Detailed Description

The Last class is a RuleBlock Activation method that activates the last \(n\) rules whose activation degrees are greater than or equal to the given threshold.

The rules are iterated in the reverse order in which they were added to the rule block.

Author
Juan Rada-Vilela, Ph.D.
See also
First
Rule
RuleBlock
ActivationFactory
Since
6.0

Definition at line 39 of file Last.h.

Constructor & Destructor Documentation

◆ Last()

fl::Last::Last ( int  numberOfRules = 1,
scalar  threshold = 0.0 
)
explicit

◆ ~Last()

virtual fl::Last::~Last ( )
virtual

Member Function Documentation

◆ activate()

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

Activates the last \(n\) rules whose activation degrees are greater than the given threshold.

The rules are iterated in the reverse order that the rules were added to the rule block.

Parameters
ruleBlockis the rule block to activate

Implements fl::Activation.

◆ className()

virtual std::string fl::Last::className ( ) const
virtual

Returns the name of the activation method, which is also utilized to register the activation method in the ActivationFactory.

Returns
the name of the activation method
See also
ActivationFactory

Implements fl::Activation.

◆ clone()

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

Clones the activation method.

Returns
a clone of the activation method

Implements fl::Activation.

◆ complexity()

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

Computes the estimated complexity of activating the given rule block.

Returns
the estimated complexity of activating the given rule block

Implements fl::Activation.

◆ configure()

virtual void fl::Last::configure ( const std::string &  parameters)
virtual

Configures the activation method with the given number of rules and threshold.

Parameters
parametersas "numberOfRules threshold"

Implements fl::Activation.

◆ constructor()

static Activation* fl::Last::constructor ( )
static

◆ getNumberOfRules()

virtual int fl::Last::getNumberOfRules ( ) const
virtual

Gets the number of rules for the activation degree.

Returns
the number of rules for the activation degree

◆ getThreshold()

virtual scalar fl::Last::getThreshold ( ) const
virtual

Gets the threshold for the activation degree.

Returns
the threshold for the activation degree

◆ parameters()

virtual std::string fl::Last::parameters ( ) const
virtual

Returns the number of rules and the threshold of the activation method.

Returns
"numberOfRules threshold"

Implements fl::Activation.

◆ setNumberOfRules()

virtual void fl::Last::setNumberOfRules ( int  numberOfRules)
virtual

Sets the number of rules for the activation degree.

Parameters
numberOfRulesis the number of rules for the activation degree

◆ setThreshold()

virtual void fl::Last::setThreshold ( scalar  threshold)
virtual

Sets the threshold for the activation degree.

Parameters
thresholdis the threshold for the activation degree

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