FuzzyRule(antecedent, consequence)

Class for representing a fuzzy rule. Fuzzy rules are comprised of an antecedent and a consequent in the form: IF antecedent THEN consequent.

Compared to ordinary if/else statements with discrete values, the consequent term of a fuzzy rule can fire to a matter of degree.

new FuzzyRule(antecedent, consequence)

Constructs a new fuzzy rule with the given values.

Parameters:
Name Type Default Description
antecedent FuzzyTerm null

Represents the condition of the rule.

consequence FuzzyTerm null

Describes the consequence if the condition is satisfied.

Author:

Members

nullable antecedent :FuzzyTerm

Represents the condition of the rule.

Default Value:
  • null

nullable consequence :FuzzyTerm

Describes the consequence if the condition is satisfied.

Default Value:
  • null

Methods

evaluate() → {FuzzyRule}

Evaluates the rule and updates the degree of membership of the consequent term with the degree of membership of the antecedent term.

Returns:
FuzzyRule -

A reference to this fuzzy rule.

fromJSON(json, fuzzySets) → {FuzzyRule}

Restores this instance from the given JSON object.

Parameters:
Name Type Description
json Object

The JSON object.

fuzzySets Map.<String, FuzzySet>

Maps fuzzy sets to UUIDs.

Returns:
FuzzyRule -

A reference to this fuzzy rule.

initConsequence() → {FuzzyRule}

Initializes the consequent term of this fuzzy rule.

Returns:
FuzzyRule -

A reference to this fuzzy rule.

toJSON() → {Object}

Transforms this instance into a JSON object.

Returns:
Object -

The JSON object.