The Triangle class is a basic Term that represents the triangular membership function.
More...
#include <Triangle.h >
The Triangle class is a basic Term that represents the triangular membership function.
triangle.svg
Author Juan Rada-Vilela, Ph.D.
See also Term
Variable
Since 4.0
Definition at line 35 of file Triangle.h .
◆ Triangle()
fl::Triangle::Triangle
(
const std::string &
name = ""
,
scalar
vertexA = fl::nan
,
scalar
vertexB = fl::nan
,
scalar
vertexC = fl::nan
,
scalar
height = 1.0
)
explicit
◆ ~Triangle()
virtual fl::Triangle::~Triangle
(
)
virtual
◆ className()
virtual std::string fl::Triangle::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 Triangle * fl::Triangle::clone
(
)
const
virtual
Creates a clone of the term.
Returns a clone of the term
Implements fl::Term .
◆ complexity()
virtual Complexity fl::Triangle::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::Triangle::configure
(
const std::string &
parameters )
virtual
Configures the term with the parameters.
Parameters
parameters as "vertexA vertexB vertexC [height]"
Implements fl::Term .
◆ constructor()
static Term * fl::Triangle::constructor
(
)
static
◆ getVertexA()
virtual scalar fl::Triangle::getVertexA
(
)
const
virtual
Gets the first vertex of the triangle.
Returns the first vertex of the triangle
◆ getVertexB()
virtual scalar fl::Triangle::getVertexB
(
)
const
virtual
Gets the second vertex of the triangle.
Returns the second vertex of the triangle
◆ getVertexC()
virtual scalar fl::Triangle::getVertexC
(
)
const
virtual
Gets the third vertex of the triangle.
Returns the third vertex of the triangle
◆ membership()
Computes the membership function evaluated at \(x\).
Parameters
Returns \(\begin{cases} 0h & \mbox{if $x \not\in [a,c]$}\cr 1h & \mbox{if $x = b$}\cr h (x - a) / (b - a) & \mbox{if $x < b$} \cr h (c - x) / (c - b) & \mbox{otherwise} \end{cases}\)
where \(h\) is the height of the Term , \(a\) is the first vertex of the Triangle , \(b\) is the second vertex of the Triangle , \(c\) is the third vertex of the Triangle
Implements fl::Term .
◆ parameters()
virtual std::string fl::Triangle::parameters
(
)
const
virtual
Returns the parameters of the term.
Returns "vertexA vertexB vertexC [height]"
Implements fl::Term .
◆ setVertexA()
virtual void fl::Triangle::setVertexA
(
scalar
a )
virtual
Sets the first vertex of the triangle.
Parameters
a is the first vertex of the triangle
◆ setVertexB()
virtual void fl::Triangle::setVertexB
(
scalar
b )
virtual
Sets the second vertex of the triangle.
Parameters
b is the second vertex of the triangle
◆ setVertexC()
virtual void fl::Triangle::setVertexC
(
scalar
c )
virtual
Sets the third vertex of the triangle.
Parameters
c is the third vertex of the triangle
The documentation for this class was generated from the following file: