Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Composing Fuzzy If–Then Rules | Fuzzy Logic Operations
Fuzzy Logic and Approximate Reasoning

bookComposing Fuzzy If–Then Rules

To build decision-making systems with fuzzy logic, you use fuzzy if–then rules. These rules allow you to express knowledge in a form like:
IF condition(s) THEN result.
In fuzzy logic, each condition is called an antecedent, and the result is the consequent. Antecedents are often based on fuzzy sets, and can involve multiple conditions combined with fuzzy operators such as AND, OR, or NOT.

For example, a rule might look like:
IF temperature is "high" AND humidity is "low" THEN fan speed is "fast".

Each antecedent evaluates to a degree of membership (between 0 and 1), based on how well the input matches the fuzzy set. When combining multiple antecedents, you use fuzzy operators:

  • AND: typically uses the minimum of the membership degrees;
  • OR: typically uses the maximum;
  • NOT: typically uses one minus the membership degree.

This way, the rule's activation can reflect partial truths, not just binary true/false values.

12345678910111213
import numpy as np # Define membership degrees for two fuzzy sets: A and B # Suppose for a given input, A = 0.7 (e.g., temperature is "high" to degree 0.7) # and B = 0.4 (e.g., humidity is "low" to degree 0.4) A = 0.7 B = 0.4 # Fuzzy rule: IF A AND B THEN C # Use the minimum t-norm for AND rule_activation = np.minimum(A, B) print("Activation degree of the rule (IF A AND B THEN C):", rule_activation)
copy

The computed activation, in this case 0.4, indicates the degree to which the rule applies for the given inputs. This value tells you how strongly the combined antecedent conditions are satisfied. In fuzzy systems, this activation degree is then used to determine the influence of the rule's consequent (e.g., how much "fan speed is fast" should be applied). Lower activation means the rule is less applicable, while higher activation means it is more relevant for the current situation.

question mark

Which statement about fuzzy if–then rules is correct?

Select the correct answer

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 3

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Suggested prompts:

Can you explain how the OR and NOT operators work in fuzzy logic?

How is the activation degree used to determine the final output in a fuzzy system?

Can you give more examples of fuzzy if–then rules?

bookComposing Fuzzy If–Then Rules

Sveip for å vise menyen

To build decision-making systems with fuzzy logic, you use fuzzy if–then rules. These rules allow you to express knowledge in a form like:
IF condition(s) THEN result.
In fuzzy logic, each condition is called an antecedent, and the result is the consequent. Antecedents are often based on fuzzy sets, and can involve multiple conditions combined with fuzzy operators such as AND, OR, or NOT.

For example, a rule might look like:
IF temperature is "high" AND humidity is "low" THEN fan speed is "fast".

Each antecedent evaluates to a degree of membership (between 0 and 1), based on how well the input matches the fuzzy set. When combining multiple antecedents, you use fuzzy operators:

  • AND: typically uses the minimum of the membership degrees;
  • OR: typically uses the maximum;
  • NOT: typically uses one minus the membership degree.

This way, the rule's activation can reflect partial truths, not just binary true/false values.

12345678910111213
import numpy as np # Define membership degrees for two fuzzy sets: A and B # Suppose for a given input, A = 0.7 (e.g., temperature is "high" to degree 0.7) # and B = 0.4 (e.g., humidity is "low" to degree 0.4) A = 0.7 B = 0.4 # Fuzzy rule: IF A AND B THEN C # Use the minimum t-norm for AND rule_activation = np.minimum(A, B) print("Activation degree of the rule (IF A AND B THEN C):", rule_activation)
copy

The computed activation, in this case 0.4, indicates the degree to which the rule applies for the given inputs. This value tells you how strongly the combined antecedent conditions are satisfied. In fuzzy systems, this activation degree is then used to determine the influence of the rule's consequent (e.g., how much "fan speed is fast" should be applied). Lower activation means the rule is less applicable, while higher activation means it is more relevant for the current situation.

question mark

Which statement about fuzzy if–then rules is correct?

Select the correct answer

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 3
some-alt