Package fuzzy :: Package set :: Module SFunction :: Class SFunction
[hide private]
[frames] | no frames]

Class SFunction

source code


Realize a S-shaped fuzzy set:

            __
           /|
          / |
         /| |
       _/ | |
        | a |
        |   |
       2*delta

See also http://pyfuzzy.sourceforge.net/demo/set/SFunction.png

Instance Methods [hide private]
 
__init__(self, a=0.0, delta=1.0)
Initialize a S-shaped fuzzy set.
source code
float
__call__(self, x)
Return membership of x in this fuzzy set.
source code
float
getCOG(self)
Return center of gravity.
source code
 
getValuesX(self)
Return sequence of x-values so we get a smooth function.
source code
string
__repr__(self)
Return representation of instance.
source code

Inherited from Set.Set: getValuesXY

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from Function.Function (private): _resolution

Instance Variables [hide private]
float a
center of set.
float delta
absolute distance between x-values for minimum and maximum.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, a=0.0, delta=1.0)
(Constructor)

source code 

Initialize a S-shaped fuzzy set.

Parameters:
  • a (float) - center of set
  • delta (float) - absolute distance between x-values for minimum and maximum
Overrides: object.__init__

__call__(self, x)
(Call operator)

source code 

Return membership of x in this fuzzy set. This method makes the set work like a function.

Parameters:
  • x (float) - value for which the membership is to calculate
Returns: float
membership
Overrides: Set.Set.__call__

getCOG(self)

source code 

Return center of gravity.

Returns: float
x-value of center of gravity
Overrides: Set.Set.getCOG

getValuesX(self)

source code 

Return sequence of x-values so we get a smooth function.

Overrides: Set.Set.getValuesX

__repr__(self)
(Representation operator)

source code 

Return representation of instance.

Returns: string
representation of instance
Overrides: object.__repr__