1   
 2   
 3   
 4   
 5   
 6   
 7   
 8   
 9   
10   
11   
12   
13   
14   
15   
16   
17   
18  """Operator class which takes value of input operator and calculates complement of it.""" 
19  __revision__ = "$Id: Not.py,v 1.18 2013-01-09 20:10:19 rliebscher Exp $" 
20   
21  from fuzzy.operator.Operator import Operator 
22   
24      """Take value of input operator and calculate complement of it. 
25          
26         @ivar input: input which result is to complement. 
27         @type input: L{fuzzy.operator.Operator.Operator} 
28      """  
29   
31          """Constructor. 
32           
33          @param input: input which result is to complement. 
34          @type input: L{fuzzy.operator.Operator.Operator} 
35          """ 
36          super(Not, self).__init__() 
37          self.input = input 
 38   
40          """Get input value and return 1.0-value.""" 
41          return 1.0 - self.input() 
 42   
44          """Return representation of instance. 
45                      
46             @return: representation of instance 
47             @rtype: string 
48             """ 
49          return "%s.%s(%s)" % (self.__class__.__module__, self.__class__.__name__, repr(self.input)) 
 50