Triangle
Triangle
¶
Bases: Term
Basic Term that represents the triangle membership function.
Equation
\(\mu(x)= \begin{cases} 0 & \mbox{if } x < a \vee x > c \cr h & \mbox{if } (x = b) \vee (a=-\infty \wedge x < b) \vee (c=\infty \wedge x > b) \cr h \dfrac{x - a}{b - a} & \mbox{if } a \le x < b \cr h \dfrac{c - x}{c - b} & \mbox{if } b < x \le c \end{cases}\)
where
- \(h\): height of the Term
- \(a\): left vertex of the Triangle
- \(b\): top vertex of the Triangle
- \(c\): right vertex of the Triangle
Attributes¶
Functions¶
__init__
¶
configure
¶
configure(parameters: str) -> None
Configure the term with the parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameters |
str
|
|
required |
membership
¶
Computes the membership function evaluated at \(x\).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Scalar
|
scalar |
required |
Returns:
Type | Description |
---|---|
Scalar
|
\(\mu(x)= \begin{cases} 0 & \mbox{if } x < a \vee x > c \cr h & \mbox{if } (x = b) \vee (a=-\infty \wedge x < b) \vee (c=\infty \wedge x > b) \cr h \dfrac{x - a}{b - a} & \mbox{if } a \le x < b \cr h \dfrac{c - x}{c - b} & \mbox{if } b < x \le c \end{cases}\) |