net.sourceforge.jFuzzyLogic.membership
Class MembershipFunctionGenericSingleton

java.lang.Object
  extended by net.sourceforge.jFuzzyLogic.membership.MembershipFunction
      extended by net.sourceforge.jFuzzyLogic.membership.MembershipFunctionDiscrete
          extended by net.sourceforge.jFuzzyLogic.membership.MembershipFunctionGenericSingleton

public class MembershipFunctionGenericSingleton
extends MembershipFunctionDiscrete

Generic singleton membership function: Allows 'n' singletons (generic discrete membership function)

Author:
pcingola@users.sourceforge.net

Field Summary
(package private)  double[] x
          Singleton function values x
(package private)  double[] y
          Singleton function values y
 
Fields inherited from class net.sourceforge.jFuzzyLogic.membership.MembershipFunction
discrete, parameters, universeMax, universeMin
 
Constructor Summary
MembershipFunctionGenericSingleton(double[] x, double[] y)
          Constructor for generin (N-values)
 
Method Summary
 boolean checkParamters(java.lang.StringBuffer errors)
           
 void estimateUniverse()
          Try to guess the universe (if not setted)
 double getParameter(int i)
          Need to override this method (we store parameters differently in this function)
 int getParametersLength()
          Need to override this method (we store parameters differently in this function)
 java.util.Iterator<java.lang.Double> iterator()
          Create an iterator for every discrete value (x values)
 double membership(double in)
          Get membership function's value.
 double membership(int index)
          Memebership function for point number 'index'
 void setParameter(int i, double value)
          Need to override this method (we store parameters differently in this function)
 int size()
          Number of points in this discrete function (i.e.
 java.lang.String toString()
           
 java.lang.String toStringFCL()
          FCL representation
 double valueX(int index)
          Value 'x' for point number 'index'
 
Methods inherited from class net.sourceforge.jFuzzyLogic.membership.MembershipFunctionDiscrete
chart
 
Methods inherited from class net.sourceforge.jFuzzyLogic.membership.MembershipFunction
getName, getUniverseMax, getUniverseMin, isDiscrete, setDiscrete, setUniverseMax, setUniverseMin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

double[] x
Singleton function values x


y

double[] y
Singleton function values y

Constructor Detail

MembershipFunctionGenericSingleton

public MembershipFunctionGenericSingleton(double[] x,
                                          double[] y)
Constructor for generin (N-values)

Parameters:
x - : x[] values array
y - : y[] values array
Method Detail

checkParamters

public boolean checkParamters(java.lang.StringBuffer errors)
Specified by:
checkParamters in class MembershipFunction

estimateUniverse

public void estimateUniverse()
Description copied from class: MembershipFunction
Try to guess the universe (if not setted)

Specified by:
estimateUniverse in class MembershipFunction

getParameter

public double getParameter(int i)
Need to override this method (we store parameters differently in this function)

Overrides:
getParameter in class MembershipFunction

getParametersLength

public int getParametersLength()
Need to override this method (we store parameters differently in this function)

Overrides:
getParametersLength in class MembershipFunction

iterator

public java.util.Iterator<java.lang.Double> iterator()
Description copied from class: MembershipFunctionDiscrete
Create an iterator for every discrete value (x values)

Specified by:
iterator in class MembershipFunctionDiscrete
Returns:
An iterator
See Also:
MembershipFunctionDiscrete.iterator()

membership

public double membership(double in)
Description copied from class: MembershipFunction
Get membership function's value.

Specified by:
membership in class MembershipFunction
Parameters:
in - : Variable's 'x' value Note: Output mu be in range [0,1]
See Also:
MembershipFunction.membership(double)

membership

public double membership(int index)
Description copied from class: MembershipFunctionDiscrete
Memebership function for point number 'index'

Specified by:
membership in class MembershipFunctionDiscrete
See Also:
MembershipFunctionDiscrete.membership(int)

setParameter

public void setParameter(int i,
                         double value)
Need to override this method (we store parameters differently in this function)

Overrides:
setParameter in class MembershipFunction

size

public int size()
Number of points in this discrete function (i.e. number of 'singletons')

Specified by:
size in class MembershipFunctionDiscrete

toString

public java.lang.String toString()
Overrides:
toString in class MembershipFunction
See Also:
Object.toString()

toStringFCL

public java.lang.String toStringFCL()
FCL representation

Specified by:
toStringFCL in class MembershipFunction

valueX

public double valueX(int index)
Description copied from class: MembershipFunctionDiscrete
Value 'x' for point number 'index'

Specified by:
valueX in class MembershipFunctionDiscrete