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 """ 19 Base class for any kind of parametric fuzzy norm. 20 """ 21 22 __revision__ = "$Id: ParametricNorm.py,v 1.16 2010-10-29 19:24:41 rliebscher Exp $" 23 24 from fuzzy.norm.Norm import Norm 25 from fuzzy.utils import prop28 """Abstract base class for any parametric fuzzy norm 29 30 @ivar p: parameter for norm 31 @type p: float 32 """ 33 _range = None 3453 def fset(self, value): # pylint: disable=W0612,C0111 54 self._checkParam(value) 55 self._p = value 56 return locals() 57 58 # pylint: disable=E0211 59 #ID:E0211 TParametricNorm.p_range: Method has no argument 60 @prop 62 """range(s) of valid values for p""" 63 def fget(self): # pylint: disable=W0612,C0111 64 return self._range 65 return locals() 6636 """Initialize type and parameter 37 38 @param param: parameter for norm 39 @type param: float 40 """ 41 super(ParametricNorm, self).__init__(type) 42 self.p = param43 44 # pylint: disable=E0202,E0211 45 #ID:E0202 ParametricNorm.p: An attribute inherited from ParametricNorm hide this method 46 #ID:E0211 TParametricNorm.p: Method has no argument 47 @prop 49 """x 50 @type: float""" 51 def fget(self): # pylint: disable=W0612,C0111 52 return self._p68 """check parameter if allowed for paramter p 69 @param value: the value to be checked 70 @type value: float""" 71 from fuzzy.utils import checkRange 72 if not checkRange(value, self._range): 73 from fuzzy.Exception import FuzzyException 74 raise FuzzyException("Parameter value %s is not allowed" % str(value))75 83
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Apr 5 22:26:14 2013 | http://epydoc.sourceforge.net |