Skip to content

ZShape

ZShape

Bases: Term

Edge Term that represents the ZShape membership function.

Equation

\(\mu(x) = \begin{cases} 1 & \mbox{if } x \leq s \cr h - 2h\left(\dfrac{x - s}{e-s}\right)^2 & \mbox{if } s < x < \dfrac{s+e}{2} \cr 2h \left(\dfrac{x - e}{e-s}\right)^2 & \mbox{if } \dfrac{s+e}{2} \le x < e\cr 0 & \mbox{otherwise} \end{cases}\)

where

  • \(h\): height of the Term
  • \(s\): start of the ZShape
  • \(e\): end of the ZShape

Attributes

end instance-attribute

end = end

start instance-attribute

start = start

Functions

__init__

__init__(name: str = '', start: float = nan, end: float = nan, height: float = 1.0) -> None

Constructor.

Parameters:

Name Type Description Default
name str

name of the Term

''
start float

start of the ZShape

nan
end float

end of the ZShape

nan
height float

height of the Term

1.0

configure

configure(parameters: str) -> None

Configure the term with the parameters.

Parameters:

Name Type Description Default
parameters str

start end [height].

required

is_monotonic

is_monotonic() -> bool

Return True because the term is monotonic.

Returns:

Type Description
bool

True

membership

membership(x: Scalar) -> Scalar

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

Parameters:

Name Type Description Default
x Scalar

scalar

required

Returns:

Type Description
Scalar

\(\mu(x) = \begin{cases} 1 & \mbox{if } x \leq s \cr h - 2h\left(\dfrac{x - s}{e-s}\right)^2 & \mbox{if } s < x < \dfrac{s+e}{2} \cr 2h \left(\dfrac{x - e}{e-s}\right)^2 & \mbox{if } \dfrac{s+e}{2} \le x < e\cr 0 & \mbox{otherwise} \end{cases}\)

parameters

parameters() -> str

Return the parameters of the term.

Returns:

Type Description
str

start end [height].

tsukamoto

tsukamoto(y: Scalar) -> Scalar

Compute the tsukamoto value of the monotonic term for activation degree \(y\).

Equation

\(y = \begin{cases} 1 & \mbox{if } x \leq s \cr h - 2h\left(\dfrac{x - s}{e-s}\right)^2 & \mbox{if } s < x < \dfrac{s+e}{2} \cr 2h \left(\dfrac{x - e}{e-s}\right)^2 & \mbox{if } \dfrac{s+e}{2} \le x < e\cr 0 & \mbox{otherwise} \end{cases}\)

\(x = \begin{cases} e + (e-s) \sqrt{\dfrac{y}{2h}} & \mbox{if } y \le \dfrac{h}{2} \cr s + (e-s) \sqrt{\dfrac{h-y}{2h}} & \mbox{otherwise} \end{cases}\)

Parameters:

Name Type Description Default
y Scalar

activation degree

required

Returns:

Type Description
Scalar

\(x = \begin{cases} e + (e-s) \sqrt{\dfrac{y}{2h}} & \mbox{if } y \le \dfrac{h}{2} \cr s + (e-s) \sqrt{\dfrac{h-y}{2h}} & \mbox{otherwise} \end{cases}\)