Game Development Reference
In-Depth Information
This is a simple logical sentence with an AND . You could also make OR or even NOT
one of the values. You can apply these same logical operators to fuzzy logic systems:
IF player is close AND I am healthy THEN Attack END
It works exactly the same way, but how do you apply this logic to fuzzy sets? The
magic comes from the attack action, which in itself is a fuzzy set. The AI can belong
to this action set as well as others.
AttackSet = player is close AND I am healthy
RunSet = player is close AND I am hurt
So what are the degrees of membership for the attack set and run set? As it turns out,
you need to redefine AND , OR , and NOT for fuzzy sets.
Given the following sentence:
R = A AND B
The traditional logical AND is defined by the truth table shown in Table 18.1.
Table 18.1 Truth Table for AND
A
B
A AND B
0
0
0
0
1
0
1
0
0
1
1
1
You need to maintain this truth table for fuzzy sets as well. The most common defi-
nition of AND for fuzzy sets turns out to be:
R = min(A, B)
In this case, A and B are the degrees of membership in those sets. Assuming that the
degree of membership in both bases is absolute (for example, 1 or 0), then this truth
table still holds true. With mixed values, the truth of the statement A AND B is essen-
tially equal to the least true member.
The reverse can be said about OR , which has the truth table shown in Table 18.2.
Search WWH ::




Custom Search