Loading…
Glossary term
A form of logic that handles degrees of truth between completely true and completely false.
Classical logic says a statement is true or false. Fuzzy logic allows degrees of truth between 0 and 1, so a temperature can be 'somewhat warm' and 'slightly hot' at once. Rules such as 'if warm then lower the heating a little' then blend smoothly.
It is used in control systems, from washing machines to trains.
A fuzzy membership function
def warm(temp_c):
# 0 below 15, 1 at 22, back to 0 above 30
if temp_c <= 15 or temp_c >= 30:
return 0.0
if temp_c <= 22:
return (temp_c - 15) / 7
return (30 - temp_c) / 8
print(warm(18), warm(22), warm(27))It handles vague, human-style concepts in a mathematical way.