Now all we have to do is clip the relevant member sets of the consequent to
the maximum of those values (ORing them together). This procedure and
the resulting set is shown in Figure 10.29.
MaxAv defuzzification method on this set results in a crisp
value of 57.16, a very similar result to that received from the traditional
fuzzy logic inference procedure.
One fantastic aspect of this method is that no changes have to be made to
the fuzzy logic classes to implement it. You only have to rewrite the rules
to conform to the Combs logic. Bonus!
NOTE If you are curious about the logic behind the Combs method, I recom
mend you examine his paper. He gives a very detailed proof of the logic behind
the method, which is well worth reading when you have a few minutes to spare.
You should now have a firm understanding of the theory behind fuzzy
logic, but you’ll need to get some practical experience under your belt
before you recognize just how powerful and flexible it is. With this in mind
I strongly suggest you try your hand at some of the following tasks (they
start easy and become increasingly complex).
Practice Makes Perfect
1. Delve into the Raven code and increase the number of sets used in the
fuzzy linguistic variables to five. This means you will have to com
pletely redefine the FLVs and the accompanying rules for each
weapon (or for just one of the weapons if you are feeling lazy J).
2. If you completed task 1 successfully you will have ended up with 25
rules. Your second challenge is to reduce the number of rules to 10 by
converting them to the Combs method.
3. As it stands, the bot aiming logic is weak. Adding random noise to the
aiming is okay but it’s not very realistic. With random noise a bot will
still occasionally make very stupid and obvious aiming errors. For
instance, on occasions when a lot of noise is added, a bot might miss a
shot that a human player — no matter how poor — would never miss.
Alternatively, when very little is added a bot will from time to time
make shots that no mortal player could ever make. (Don’t you just
hate it when that happens!)
Fuzzy Logic | 455