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

The Binary class is an edge Term that represents the binary membership function. More...

#include <Binary.h>

Inheritance diagram for fl::Binary:
Collaboration diagram for fl::Binary:

Public Types

enum  Direction { Positive, Undefined, Negative }
 Direction is an enumerator that indicates the direction of the edge. More...
 

Public Member Functions

 Binary (const std::string &name="", scalar start=fl::nan, scalar direction=fl::nan, scalar height=1.0)
 
virtual ~Binary () FL_IOVERRIDE
 
virtual std::string className () const FL_IOVERRIDE
 Returns the name of the class of the term. More...
 
virtual std::string parameters () const FL_IOVERRIDE
 Returns the parameters of the term. More...
 
virtual void configure (const std::string &parameters) FL_IOVERRIDE
 Configures the term with the parameters. More...
 
virtual Complexity complexity () const FL_IOVERRIDE
 Computes the estimated complexity of evaluating the membership function. More...
 
virtual scalar membership (scalar x) const FL_IOVERRIDE
 Computes the membership function evaluated at \(x\). More...
 
virtual void setStart (scalar start)
 Sets the start of the binary edge. More...
 
virtual scalar getStart () const
 Gets the start of the binary edge. More...
 
virtual void setDirection (scalar direction)
 Sets the direction of the binary edge. More...
 
virtual scalar getDirection () const
 Gets the direction of the binary edge. More...
 
virtual Direction direction () const
 Gets the Direction of the binary edge as an enumerator. More...
 
virtual Binaryclone () const FL_IOVERRIDE
 Creates a clone of the term. More...
 
- Public Member Functions inherited from fl::Term
 Term (const std::string &name="", scalar height=1.0)
 
virtual ~Term ()
 
virtual void setName (const std::string &name)
 Sets the name of the term. More...
 
virtual std::string getName () const
 Gets the name of the term. More...
 
virtual void setHeight (scalar height)
 Sets the height of the term. More...
 
virtual scalar getHeight () const
 Gets the height of the term. More...
 
virtual std::string toString () const
 Returns the representation of the term in the FuzzyLite Language. More...
 
virtual void updateReference (const Engine *engine)
 Updates the references (if any) to point to the current engine (useful when cloning engines or creating terms within Importer objects. More...
 

Static Public Member Functions

static Termconstructor ()
 

Additional Inherited Members

- Protected Attributes inherited from fl::Term
scalar _height
 

Detailed Description

The Binary class is an edge Term that represents the binary membership function.

binary.svg
Author
Juan Rada-Vilela, Ph.D.
See also
Term
Variable
Since
6.0

Definition at line 35 of file Binary.h.

Member Enumeration Documentation

◆ Direction

Direction is an enumerator that indicates the direction of the edge.

Enumerator
Positive 

(_|) increases to the right (infinity)

Undefined 

(--) direction is NaN

Negative 

(|_) increases to the left (-infinity)

Definition at line 45 of file Binary.h.

Constructor & Destructor Documentation

◆ Binary()

fl::Binary::Binary ( const std::string &  name = "",
scalar  start = fl::nan,
scalar  direction = fl::nan,
scalar  height = 1.0 
)
explicit

◆ ~Binary()

virtual fl::Binary::~Binary ( )
virtual

Member Function Documentation

◆ className()

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

Returns the name of the class of the term.

Returns
the name of the class of the term

Implements fl::Term.

◆ clone()

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

Creates a clone of the term.

Returns
a clone of the term

Implements fl::Term.

◆ complexity()

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

Computes the estimated complexity of evaluating the membership function.

Returns
the estimated complexity of evaluating the membership function

Implements fl::Term.

◆ configure()

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

Configures the term with the parameters.

Parameters
parametersas "start direction [height]"

Implements fl::Term.

◆ constructor()

static Term* fl::Binary::constructor ( )
static

◆ direction()

virtual Direction fl::Binary::direction ( ) const
virtual

Gets the Direction of the binary edge as an enumerator.

Returns
the Direction of the binary edge as an enumerator

◆ getDirection()

virtual scalar fl::Binary::getDirection ( ) const
virtual

Gets the direction of the binary edge.

Returns
the direction of the binary edge

◆ getStart()

virtual scalar fl::Binary::getStart ( ) const
virtual

Gets the start of the binary edge.

Returns
the start of the binary edge

◆ membership()

virtual scalar fl::Binary::membership ( scalar  x) const
virtual

Computes the membership function evaluated at \(x\).

Parameters
x
Returns
\(\begin{cases} 1h & \mbox{if $ \left(s < d \vedge x \in [s, d)\right) \wedge \left( s > d \vedge x \in (d, s] \right) $} \cr 0h & \mbox{otherwise} \end{cases}\)

where \(h\) is the height of the Term, \(s\) is the start of the Binary edge, \(d\) is the direction of the Binary edge.

Implements fl::Term.

◆ parameters()

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

Returns the parameters of the term.

Returns
"start direction [height]"

Implements fl::Term.

◆ setDirection()

virtual void fl::Binary::setDirection ( scalar  direction)
virtual

Sets the direction of the binary edge.

\(\begin{cases} \text{Positive} & \mbox{if $ d > s $}\cr \text{Negative} & \mbox{if $ d < s $}\cr \mbox{\tt NaN} & \mbox{otherwise} \end{cases} \)

where \(d\) is the given direction, and \(s\) is the start of the Binary edge

Parameters
directionis the direction of the binary edge

◆ setStart()

virtual void fl::Binary::setStart ( scalar  start)
virtual

Sets the start of the binary edge.

Parameters
startis the start of the binary edge

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