1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 """Complement after Sugeno"""
19 __revision__ = "$Id: Sugeno.py,v 1.7 2010-03-28 18:39:02 rliebscher Exp $"
20
21 from fuzzy.complement.Parametric import Parametric
22 from fuzzy.utils import inf_p
23
25 """Complement after Sugeno"""
26
27 _range = [ (-1., inf_p) ]
28
29 - def __init__(self, lambda_=0., *args, **keywords):
30 """Initialize instance with given parameter
31 @param lambda_: The parameter
32 @type lambda_: float
33 """
34 super(Sugeno, self).__init__(lambda_, *args, **keywords)
35
37 """calculate the complement of the value
38 @param value: the value to complement
39 @type value: float
40 @return: the complemented value
41 @rtype: float
42 """
43 return (1.-float(value))/(1.+self.p*float(value))
44
46 """Return representation of instance.
47
48 @return: representation of instance
49 @rtype: string
50 """
51 return "%s.%s(lambda_=%s)" % (self.__class__.__module__, self.__class__.__name__, self.p)
52