Game Development Reference
In-Depth Information
FIG 5.16 Classical sets have distinct
boundaries. Fuzzy sets do not.
A fuzzy rule can be written as
if x is A
then y is B
where x and y , known as linguistic variables , represent the characteristics
being measured (temperature, speed, height, etc.) and A and B , known as
linguistic values , are the fuzzy categories (hot, fast, tall, etc.). A fuzzy rule can
also include AND and OR statements similar to those in Boolean algebra. The
following are examples of fuzzy rules:
if temperature is hot
or UV_index is high
then sunburn is likely
if temperature is warm
and humidity is low
then drying_time will be quick
Given a set of fuzzy rules and a number of inputs, an output value can be
deduced using fuzzy inferencing. There are two common ways to inference on
fuzzy rules: Mamdani style and Sugeno style, both named after their creators.
The Mamdani style is widely accepted for capturing human knowledge and
uses a more intuitive form of expressing rules.
The Mamdani style consists of four steps: fuzzification, rule evaluation,
aggregation, and defuzzification. Consider the following rules by which
an NPC may operate:
Rule 1:
if health is good
then mood is happy
Rule 2:
or shield is moderate
then mood is indifferent
Rule 3: