Flex.Set (FLex v0.2.2)

View Source

An interface to create Fuzzy Sets struct.

Summary

Types

t()

Fuzzy Set struct.

Functions

Creates a Fuzzy set.

Updates a Fuzzy set with new membership function parameters.

Updates a Fuzzy set depending on the gradient.

Types

t()

@type t() :: %Flex.Set{
  mf: fun(),
  mf_center: integer() | float(),
  mf_params: keyword(),
  mf_type: String.t(),
  tag: String.t()
}

Fuzzy Set struct.

  • :mf_type - Defines which type of membership function uses the set.
  • :mf - Anonymous function reference of the membership function.
  • :mf_center - The center point of the membership function.
  • :mf_params - The parameters of the membership function.
  • :tag - Linguistic name of the fuzzy set.

Functions

new(opt)

@spec new(keyword()) :: t()

Creates a Fuzzy set.

The following options are require:

  • :mf_type - (string) Defines which type of membership function uses the set (e.g., "triangle").
  • :tag - (string) defines the linguistic name of the fuzzy set (e.g., "too hot"),
  • :mf_params - The parameters of the membership function, see Membership functions.

update(fuzzy_set, new_mf_params)

@spec update(t(), list()) :: t()

Updates a Fuzzy set with new membership function parameters.

update(fuzzy_set, gradient, learning_rate)

@spec update(t(), list(), number()) :: t()

Updates a Fuzzy set depending on the gradient.