The Cosine class is an extended Term that represents the cosine membership function.
More...
#include <Cosine.h>
The Cosine class is an extended Term that represents the cosine membership function.
- Author
- Juan Rada-Vilela, Ph.D.
- See also
- Term
-
Variable
- Since
- 5.0
Definition at line 36 of file Cosine.h.
◆ Cosine()
fl::Cosine::Cosine |
( |
const std::string & |
name = "" , |
|
|
scalar |
center = fl::nan , |
|
|
scalar |
width = fl::nan , |
|
|
scalar |
height = 1.0 |
|
) |
| |
|
explicit |
◆ ~Cosine()
virtual fl::Cosine::~Cosine |
( |
| ) |
|
|
virtual |
◆ className()
virtual std::string fl::Cosine::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 Cosine* fl::Cosine::clone |
( |
| ) |
const |
|
virtual |
Creates a clone of the term.
- Returns
- a clone of the term
Implements fl::Term.
◆ complexity()
virtual Complexity fl::Cosine::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::Cosine::configure |
( |
const std::string & |
parameters | ) |
|
|
virtual |
Configures the term with the parameters.
- Parameters
-
parameters | as "center width [height]" |
Implements fl::Term.
◆ constructor()
static Term* fl::Cosine::constructor |
( |
| ) |
|
|
static |
◆ getCenter()
virtual scalar fl::Cosine::getCenter |
( |
| ) |
const |
|
virtual |
Gets the center of the cosine.
- Returns
- the center of the cosine
◆ getWidth()
virtual scalar fl::Cosine::getWidth |
( |
| ) |
const |
|
virtual |
Gets the width of the cosine.
- Returns
- the width of the cosine
◆ membership()
Computes the membership function evaluated at \(x\).
- Parameters
-
- Returns
- \(\begin{cases} 0h & \mbox{if $x < c - 0.5w \vee x > c + 0.5w$} \cr 0.5h \times ( 1 + \cos(2.0 / w\pi(x-c))) & \mbox{otherwise} \end{cases}\)
where \(h\) is the height of the Term, \(c\) is the center of the Cosine, \(w\) is the width of the Cosine
Implements fl::Term.
◆ parameters()
virtual std::string fl::Cosine::parameters |
( |
| ) |
const |
|
virtual |
Returns the parameters of the term.
- Returns
"center width [height]"
Implements fl::Term.
◆ setCenter()
virtual void fl::Cosine::setCenter |
( |
scalar |
center | ) |
|
|
virtual |
Sets the center of the cosine.
- Parameters
-
center | is the center of the cosine |
◆ setWidth()
virtual void fl::Cosine::setWidth |
( |
scalar |
width | ) |
|
|
virtual |
Sets the width of the cosine.
- Parameters
-
width | is the width of the cosine |
The documentation for this class was generated from the following file: