Hi,
developing a game with Fuzzy Logic I’m starting to have too many rules. To solve that, I wanted to reduce its number by using “the combs method” (a AND b then C ==> a then C OR b then C).
I’ve seen many examples… but I just don’t get it. It seems like they just “guess” logically which rules they can do again and they are supposed to work fine :S
In the book “Programming Game AI by Example” is written:
One major problem with fuzzy inference systems is that as the complexity of the problem increases, the number of rules required escalates at an alarming rate. For example, the simple module created to solve the weapon selection problem only required nine rules — one for each possible combination of the antecedent sets — but if we add just one more FLV, again consisting of three member sets, then 27 rules are necessary. It gets much worse if the number of member sets in each FLV has to be increased to obtain more precision. For instance, 125 rules are required for a system with three FLVs each containing five member sets. Add another FLV consisting of five member sets and the number skyrockets to 625 rules! This effect is known as combinatorial explosion and is a huge problem when designing fuzzy systems for time-critical applications, which of course is what computer games are.
Luckily for us, we have a knight in shining armor in the form of William Combs, an engineer with Boeing. In 1997 Combs proposed a system that enables the number of rules to grow linearly with the number of member sets instead of exponentially.
The theory behind the Combs method works on the principle that a rule such as:
IF Target_Far AND Ammo_Loads THEN Desirable
is logically equivalent to:
IF Target_Far THEN Desirable
OR
IF Ammo_Loads THEN Desirable
Using this principle, a rule base can be defined that contains only one rule per consequent member set. For example, the nine rules for the desirability of the rocket launcher given previously:
Rule 1. IF Target_Far AND Ammo_Loads THEN Desirable
Rule 2. IF Target_Far AND Ammo_Okay THEN Undesirable
Rule 3. IF Target_Far AND Ammo_Low THEN Undesirable
Rule 4. IF Target_Medium AND Ammo_Loads THEN VeryDesirable
Rule 5. IF Target_Medium AND Ammo_Okay THEN VeryDesirable
Rule 6. IF Target_Medium AND Ammo_Low THEN Desirable
Rule 7. IF Target_Close AND Ammo_Loads THEN Undesirable
Rule 8. IF Target_Close AND Ammo_Okay THEN Undesirable
Rule 9. IF Target_Close AND Ammo_Low THEN Undesirable
can be reduced to six rules:
Rule 1. IF Target_Close THEN Undesirable
Rule 2. IF Target_Medium THEN VeryDesirable
Rule 3. IF Target_Far THEN Undesirable
Rule 4. IF Ammo_Low THEN Undesirable
Rule 5. IF Ammo_Okay THEN Desirable
Rule 6. IF Ammo_Loads THEN VeryDesirable
How is he able to get that 6 rules? I don’t find a pattern
Thanks!