1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 """Complement after Yager"""
19 __revision__ = "$Id: Yager.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 Yager"""
26
27 _range = [ (0., inf_p) ]
28
29 - def __init__(self, omega=1., *args, **keywords):
30 """Initialize instance with given parameter
31 @param omega: The parameter
32 @type omega: float
33 """
34 super(Yager, self).__init__(omega, *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 pow(1. - pow(float(value), self.p), 1. / self.p)
44
46 """Return representation of instance.
47
48 @return: representation of instance
49 @rtype: string
50 """
51 return "%s.%s(omega=%s)" % (self.__class__.__module__, self.__class__.__name__, self.p)
52