new FuzzyModule()
Constructs a new fuzzy module.
Members
-
readonly flvs :Map.<String, FuzzyVariable>
-
A map of FLVs.
-
readonly rules :Array.<FuzzyRule>
-
An array of the fuzzy rules.
Methods
-
addFLV(name, flv) → {FuzzyModule}
-
Adds the given FLV under the given name to this fuzzy module.
Parameters:
Name Type Description name
String The name of the FLV.
flv
FuzzyVariable The FLV to add.
-
addRule(rule) → {FuzzyModule}
-
Adds the given fuzzy rule to this fuzzy module.
Parameters:
Name Type Description rule
FuzzyRule The fuzzy rule to add.
-
defuzzify(name, type) → {Number}
-
Given a fuzzy variable and a defuzzification method this returns a crisp value.
Parameters:
Name Type Description name
String The name of the FLV
type
String The type of defuzzification.
Returns:
Number -The defuzzified, crips value.
-
fromJSON(json) → {FuzzyModule}
-
Restores this instance from the given JSON object.
Parameters:
Name Type Description json
Object The JSON object.
-
fuzzify(name, value) → {FuzzyModule}
-
Calls the fuzzify method of the defined FLV with the given value.
Parameters:
Name Type Description name
String The name of the FLV
value
Number The crips value to fuzzify.
-
removeFLV(name) → {FuzzyModule}
-
Remove the FLV under the given name from this fuzzy module.
Parameters:
Name Type Description name
String The name of the FLV to remove.
-
removeRule(rule) → {FuzzyModule}
-
Removes the given fuzzy rule from this fuzzy module.
Parameters:
Name Type Description rule
FuzzyRule The fuzzy rule to remove.
-
toJSON() → {Object}
-
Transforms this instance into a JSON object.
Returns:
Object -The JSON object.