Skip to content

WeightedDefuzzifier

WeightedDefuzzifier

Bases: Defuzzifier

Abstract class for defuzzifiers that compute a weighted function on the fuzzy set.

related

Attributes

type instance-attribute

type = Type[type]

Classes

Type

Bases: Enum

Type of the weighted defuzzifier based on the terms in the fuzzy set.

  • Automatic: Automatically inferred from the terms
  • TakagiSugeno: Manually set to TakagiSugeno (or Inverse Tsukamoto)
  • Tsukamoto: Manually set to Tsukamoto
Attributes
Automatic class-attribute instance-attribute
Automatic = auto()
TakagiSugeno class-attribute instance-attribute
TakagiSugeno = auto()
Tsukamoto class-attribute instance-attribute
Tsukamoto = auto()
Functions
__repr__
__repr__() -> str

Return the code to identify the type of defuzzifier in Python.

Returns:

Type Description
str

code to identify the type of defuzzifier in Python.

Functions

__init__

__init__(type: str | Type = Type.Automatic) -> None

Constructor.

Parameters:

Name Type Description Default
type str | Type

name or type of the weighted defuzzifier.

Automatic

__repr__

__repr__() -> str

Return the code to construct the defuzzifier in Python.

Returns:

Type Description
str

code to construct the defuzzifier in Python.

configure

configure(parameters: str) -> None

Configure the defuzzifier with the parameters.

Parameters:

Name Type Description Default
parameters str

list of space-separated parameter values

required

defuzzify abstractmethod

defuzzify(term: Term, minimum: float = nan, maximum: float = nan) -> Scalar

Implement the defuzzification of the term.

Warning

From version 8, the aggregation operator is used to aggregate multiple activations of the same term.

In previous versions, the implication and aggregation operators are not used for weighted defuzzification.

Parameters:

Name Type Description Default
term Term

term to defuzzify

required
minimum float

irrelevant

nan
maximum float

irrelevant

nan

Returns:

Type Description
Scalar

defuzzified value

infer_type classmethod

infer_type(component: Term | Variable) -> Type

Infer the type of the defuzzifier based on the component.

Parameters:

Name Type Description Default
component Term | Variable

term or variable to infer the type for

required

Returns:

Type Description
Type

inferred type of the defuzzifier based on the component.

parameters

parameters() -> str

Return the parameters to configure the defuzzifier.

Returns:

Type Description
str

parameters to configure the defuzzifier.