Package fuzzy :: Package operator :: Module Operator
[hide private]
[frames] | no frames]

Source Code for Module fuzzy.operator.Operator

 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  """ 
19      Calculate value for fuzzy rule. 
20       
21      Used to build fuzzy rules. 
22  """ 
23   
24  __revision__ = "$Id: Operator.py,v 1.15 2010-10-29 19:24:41 rliebscher Exp $" 
25   
26 -class Operator(object): # pylint: disable=R0903
27 """Abstract base class for any kind of operator.""" 28
29 - def __init__(self):
30 """Dummy initialization, so it is safe to call it 31 from any sub class.""" 32 pass
33
34 - def __call__(self):
35 """Return current value. 36 37 @return: result of operator calculation 38 @rtype: float 39 @raise fuzzy.FuzzyException.FuzzyException: any problem in calculation 40 """ 41 raise NotImplementedError("abstract class %s can't be called" % self.__class__.__name__)
42