Skip to content

Aggregated

Aggregated

Bases: Term

Special term that represents a fuzzy set of activated terms to mainly serve as the fuzzy output value of output variables.

Equation

\(\mu(x)=\bigoplus_i^n\alpha_i\otimes\mu_i(x) = \alpha_1\otimes\mu_1(x) \oplus \ldots \oplus \alpha_n\otimes\mu_n(x)\)

where

  • \(\alpha_i\): activation degree of term \(i\)
  • \(\mu_i\): membership function of term \(i\)
  • \(\otimes\): implication operator
  • \(\oplus\): aggregation operator
related

Attributes

aggregation instance-attribute

aggregation = aggregation

maximum instance-attribute

maximum = maximum

minimum instance-attribute

minimum = minimum

terms instance-attribute

terms = list(terms or [])

Functions

__init__

__init__(
    name: str = "",
    minimum: float = nan,
    maximum: float = nan,
    aggregation: SNorm | None = None,
    terms: Iterable[Activated] | None = None,
) -> None

Constructor.

Parameters:

Name Type Description Default
name str

name of the aggregated term

''
minimum float

minimum value of the range of the fuzzy set

nan
maximum float

maximum value of the range of the fuzzy set

nan
aggregation SNorm | None

aggregation operator

None
terms Iterable[Activated] | None

list of activated terms

None

__repr__

__repr__() -> str

Return the code to construct the term in Python.

Returns:

Type Description
str

code to construct the term in Python.

activation_degree

activation_degree(term: Term) -> Scalar

Compute the aggregated activation degree of the term.

Parameters:

Name Type Description Default
term Term

term to compute the aggregated activation degree

required

Returns:

Type Description
Scalar

aggregated activation degree for the term.

clear

clear() -> None

Clear the list of activated terms.

grouped_terms

grouped_terms() -> dict[str, Activated]

Group the activated terms and aggregate their activation degrees.

Returns:

Type Description
dict[str, Activated]

grouped activated terms by name with aggregated activation degrees.

related

highest_activated_term

highest_activated_term() -> Activated | None

Find the term with the maximum aggregated activation degree.

Returns:

Type Description
Activated | None

term with the maximum aggregated activation degree.

Raises:

Type Description
ValueError

when working with vectorization (eg, size(activation_degree) > 1)

membership

membership(x: Scalar) -> Scalar

Aggregate the activated terms' membership function values of \(x\) using the aggregation operator.

Parameters:

Name Type Description Default
x Scalar

scalar

required

Returns:

Type Description
Scalar

\(\mu(x)=\bigoplus_i^n\alpha_i\otimes\mu_i(x) = \alpha_1\otimes\mu_1(x) \oplus \ldots \oplus \alpha_n\otimes\mu_n(x)\)

parameters

parameters() -> str

Return the space-separated parameters of the term.

Returns:

Type Description
str

aggregation minimum maximum terms

range

range() -> float

Return the magnitude of the range of the fuzzy set.

Returns:

Type Description
float

maximum - minimum