nrc.fuzzy
Class CompensatoryAndAntecedentCombineOperator

java.lang.Object
  |
  +--nrc.fuzzy.AntecedentCombineOperator
        |
        +--nrc.fuzzy.CompensatoryAndAntecedentCombineOperator
All Implemented Interfaces:
AntecedentCombineOperatorInterface, java.lang.Cloneable, java.io.Serializable

public class CompensatoryAndAntecedentCombineOperator
extends AntecedentCombineOperator
implements java.io.Serializable

A class that provides a special operator referred to as the 'compensatory and' operator to combine the fuzzy match values of antecedent/input pairs in a rule when a rule is fired which has multiple antecedents.

The formula for the operator is:

  u = (PROD(u(i)))**(1-gamma) * (1-(PROD(1-u(i))))**gamma
 
  where PROD(u(i)) means the product of a set of values
                   u(i), with i ranging from 1 to m
  and gamma is a value between 0 and 1 that controls the 'compensation'.
      (the default gamma value is 0.562)
 

Note that by setting gamma to 0 we get the equivalent of the ProductAntecedentCombineOperator.
This is detailed in FuzzySet Theory and Its Applications, Second Edition, by Zimmermann, Kluwer Acedemic Publishers, 1990.

See Also:
AntecedentCombineOperator, MinimumAntecedentCombineOperator, ProductAntecedentCombineOperator, FuzzyRule, Serialized Form

Constructor Summary
CompensatoryAndAntecedentCombineOperator()
          Constructor to create an object with the default gamma value of 0.562.
CompensatoryAndAntecedentCombineOperator(double g)
          Constructor to create an object with the specified gamma value.
 
Method Summary
 double execute(double[] matchValues)
          Implements the 'compensatory and' of the match values in the double array.
 double getGamma()
          Get the gamma value used in the Compensatory And calculation
 void setGamma(double g)
          Set the gamma value used in the Compensatory And calulation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompensatoryAndAntecedentCombineOperator

public CompensatoryAndAntecedentCombineOperator()
Constructor to create an object with the default gamma value of 0.562.


CompensatoryAndAntecedentCombineOperator

public CompensatoryAndAntecedentCombineOperator(double g)
Constructor to create an object with the specified gamma value. Note that by setting gamma to 0 we get the equivalent of the ProductAntecedentCombineOperator.

Parameters:
g - the gamma value for the object
Method Detail

setGamma

public void setGamma(double g)
Set the gamma value used in the Compensatory And calulation

Parameters:
g - the gamma value to be set (must be between 0 and 1)

getGamma

public double getGamma()
Get the gamma value used in the Compensatory And calculation

Returns:
the gamma value

execute

public double execute(double[] matchValues)
Implements the 'compensatory and' of the match values in the double array.

Specified by:
execute in interface AntecedentCombineOperatorInterface
Parameters:
matchValues -
Returns:
the 'compensatory and' of values in the array parameter