Home | Trees | Indices | Help |
|
---|
|
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 """Abstract base class for any parametric fuzzy complement""" 19 __revision__ = "$Id: Parametric.py,v 1.9 2010-10-29 19:24:41 rliebscher Exp $" 20 21 from fuzzy.complement.Base import Base 22 from fuzzy.utils import prop25 """Abstract base class for any parametric fuzzy complement 26 27 @ivar p: parameter for complement 28 @type p: float 29 """ 30 _range = None 3150 def fset(self, value): # pylint: disable=W0612,C0111 51 self._checkParam(value) 52 self._p = value 53 return locals() 54 55 # pylint: disable=E0211 56 #ID:E0211 Parametric.p_range: Method has no argument 57 @prop 59 """range(s) of valid values for p""" 60 def fget(self): # pylint: disable=W0612,C0111 61 return self._range 62 return locals() 6333 """Initialize type and parameter 34 35 @param p: parameter for complement 36 @type p: float 37 """ 38 super(Parametric, self).__init__(*args, **keywords) 39 self.p = p40 41 # pylint: disable=E0211,E0202 42 #ID:E0211 Parametric.p: Method has no argument 43 #ID:E0202 Parametric.p: An attribute inherited from Parametric hide this method 44 @prop 46 """x 47 @type: float""" 48 def fget(self): # pylint: disable=W0612,C0111 49 return self._p65 """check parameter if allowed for parameter p 66 @param value: the value to be checked 67 @type value: float""" 68 from fuzzy.utils import checkRange 69 if not checkRange(value, self._range): 70 from fuzzy.Exception import FuzzyException 71 raise FuzzyException("Parameter value %s is not allowed" % str(value))72 80
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Apr 5 22:26:12 2013 | http://epydoc.sourceforge.net |