O'Reilly logo

Programming Game AI by Example by Mat Buckland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

intelligence. A human will consider him to be mostly clever, above aver
-
age, which is exactly what can be inferred from his fuzzy set membership
values.
Ü
NOTE It’s worth noting that the linguistic terms associated with fuzzy sets
can change their meaning when used in differing frames of reference. For
example, the meaning of the fuzzy sets Tall, Medium, and Short will be different
for Europeans than it would be for the pygmies of South America. All fuzzy sets,
therefore, are defined and used within a context.
A membership function can be written in mathematical notation like this:
(10.4)
Using this notation we can write Brian’s degree of membership, or DOM
for short, in the fuzzy set Clever as:
(10.5)
Fuzzy Set Operators
Intersections, unions, and complements of fuzzy sets are possible, just as
they are with crisp sets. The fuzzy intersection operation is mathematically
equivalent to the AND operator. The result of ANDing two or more fuzzy
sets together is another fuzzy set. The fuzzy set of people who are Average
AND Clever is shown graphically in Figure 10.6.
The graphical example illustrates well how the AND operator is equivalent
to taking the minimum DOM (degree of membership) for each set a value
is a member of. This is written mathematically as:
(10.6)
Fuzzy Logic | 421
Fuzzy Sets
Figure 10.6. The set of people who are Average AND Clever
__
()
Name of set
Fx
()
(115) 0.75
Brian Clever
Clever F==
{}
() min (), ()
Average Clever Average Clever
FxFxFx
Ç
=
Brian’s degree of membership in the set of people who are Average AND
Clever is 0.25.
The union of fuzzy sets is equivalent to the OR operator. The compound
set that is the result of ORing two or more sets together uses the maximum
of the DOMs of the component sets. For the sets Average and Clever this is
written as:
(10.7)
Figure 10.7 shows the set of people who are Average OR Clever. Brian’s
membership in this set is 0.75.
The complement of a value with a DOM of m is 1–m. Figure 10.8 describes
the set of people who are NOT Clever. We saw earlier how Brian’s degree
of membership to Clever is 0.75, so his DOM to NOT Clever should be 1 –
0.75 = 0.25, which is exactly what we can see in the figure.
422 | Chapter 10
Fuzzy Sets
Figure 10.7. The set of people who are Average OR Clever
Figure 10.8. The complement of Clever
{}
() max (), ()
Average Clever Average Clever
FxFxFx
È
=

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required