Package fuzzy :: Package complement :: Module Zadeh
[hide private]
[frames] | no frames]

Source Code for Module fuzzy.complement.Zadeh

 1  # -*- coding: utf-8 -*- 
 2  # 
 3  # Copyright (C) 2009  Rene Liebscher 
 4  # 
 5  # This program is free software; you can redistribute it and/or modify it under 
 6  # the terms of the GNU Lesser General Public License as published by the Free  
 7  # Software Foundation; either version 3 of the License, or (at your option) any 
 8  # later version. 
 9  # 
10  # This program is distributed in the hope that it will be useful, but WITHOUT  
11  # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
12  # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 
13  # details. 
14  #  
15  # You should have received a copy of the GNU Lesser General Public License 
16  # along with this program; if not, see <http://www.gnu.org/licenses/>.  
17  # 
18  """Complement after Zadeh""" 
19  __revision__ = "$Id: Zadeh.py,v 1.6 2010-10-29 19:24:41 rliebscher Exp $" 
20   
21  from fuzzy.complement.Base import Base 
22   
23 -class Zadeh(Base): # pylint: disable=R0903
24 """Complement after Zadeh""" 25
26 - def __init__(self, *args, **keywords):
27 """Initialize the complement instance""" 28 super(Zadeh, self).__init__(*args, **keywords)
29
30 - def __call__(self, value):
31 """calculate the complement of the value 32 @param value: the value to complement 33 @type value: float 34 @return: the complemented value 35 @rtype: float 36 """ 37 return 1. - float(value)
38