# Fuzzy Logic -\> Combs Method

**URL:** <https://forum.kirupa.com/t/fuzzy-logic-combs-method/325012>\
**Category:** programming\
**Created:** [September 21, 2011, 8:30am UTC](https://forum.kirupa.com/t/fuzzy-logic-combs-method/325012 "2011-09-21T08:30:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jano\_alex\_es](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@jano\_alex\_es](https://forum.kirupa.com/u/jano_alex_es)\
**Post date:** [September 21, 2011, 8:30am UTC](https://forum.kirupa.com/t/fuzzy-logic-combs-method/325012/1 "2011-09-21T08:30:34Z")

</div>

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!
