FuzzyVariable()

Class for representing a fuzzy linguistic variable (FLV). A FLV is the composition of one or more fuzzy sets to represent a concept or domain qualitatively. For example fuzzs sets "Dumb", "Average", and "Clever" are members of the fuzzy linguistic variable "IQ".

new FuzzyVariable()

Constructs a new fuzzy linguistic variable.

Author:

Members

readonly fuzzySets :Array.<FuzzySet>

An array of the fuzzy sets that comprise this FLV.

readonly maxRange :Number

The maximum value range of this FLV. This value is automatically updated when adding/removing fuzzy sets.

Default Value:
  • - Infinity

readonly minRange :Number

The minimum value range of this FLV. This value is automatically updated when adding/removing fuzzy sets.

Default Value:
  • Infinity

Methods

add(fuzzySet) → {FuzzyVariable}

Adds the given fuzzy set to this FLV.

Parameters:
Name Type Description
fuzzySet FuzzySet

The fuzzy set to add.

Returns:
FuzzyVariable -

A reference to this FLV.

defuzzifyCentroid(samples) → {Number}

Defuzzifies the FLV using the "Centroid" method.

Parameters:
Name Type Default Description
samples Number 10

The amount of samples used for defuzzification.

Returns:
Number -

The defuzzified, crips value.

defuzzifyMaxAv() → {Number}

Defuzzifies the FLV using the "Average of Maxima" (MaxAv) method.

Returns:
Number -

The defuzzified, crips value.

fromJSON(json) → {FuzzyVariable}

Restores this instance from the given JSON object.

Parameters:
Name Type Description
json Object

The JSON object.

Returns:
FuzzyVariable -

A reference to this fuzzy variable.

fuzzify(value) → {FuzzyVariable}

Fuzzifies a value by calculating its degree of membership in each of this variable's fuzzy sets.

Parameters:
Name Type Description
value Number

The crips value to fuzzify.

Returns:
FuzzyVariable -

A reference to this FLV.

remove(fuzzySet) → {FuzzyVariable}

Removes the given fuzzy set from this FLV.

Parameters:
Name Type Description
fuzzySet FuzzySet

The fuzzy set to remove.

Returns:
FuzzyVariable -

A reference to this FLV.

toJSON() → {Object}

Transforms this instance into a JSON object.

Returns:
Object -

The JSON object.