new FuzzyVariable()
Constructs a new fuzzy linguistic variable.
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.
-
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.
-
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.
-
remove(fuzzySet) → {FuzzyVariable}
-
Removes the given fuzzy set from this FLV.
Parameters:
Name Type Description fuzzySet
FuzzySet The fuzzy set to remove.
-
toJSON() → {Object}
-
Transforms this instance into a JSON object.
Returns:
Object -The JSON object.