Skip to content

PiShape

PiShape

Bases: Term

Extended term that represents the Pi-shaped membership function.

Equation

\(\mu(x) = h \left(\mbox{SShape}_{a}^{b}(x) \times \mbox{ZShape}_{c}^{d}(x)\right)\)

where

  • \(h\): height of the Term
  • \(a, b\): bottom left and top left parameters of the PiShape
  • \(c, d\): top right and bottom right parameters of the PiShape
related

Attributes

bottom_left instance-attribute

bottom_left = bottom_left

bottom_right instance-attribute

bottom_right = bottom_right

top_left instance-attribute

top_left = top_left

top_right instance-attribute

top_right = top_right

Functions

__init__

__init__(
    name: str = "",
    bottom_left: float = nan,
    top_left: float = nan,
    top_right: float = nan,
    bottom_right: float = nan,
    height: float = 1.0,
) -> None

Constructor.

Parameters:

Name Type Description Default
name str

name of the Term

''
bottom_left float

bottom-left value of the PiShape

nan
top_left float

top-left value of the PiShape

nan
top_right float

top-right value of the PiShape

nan
bottom_right float

bottom-right value of the PiShape

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

bottom_left top_left top_right bottom_right [height].

required

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) = h \left(\mbox{SShape}_{a}^{b}(x) \times \mbox{ZShape}_{c}^{d}(x)\right)\)

parameters

parameters() -> str

Return the parameters of the term.

Returns:

Type Description
str

bottom_left top_left top_right bottom_right [height].