# Path: fuzzy/norm/Norm.py
# class NormException(Exception):
#     """Base class for any exception in norm calculations."""
#     pass
# 
# Path: fuzzy/norm/ParametricNorm.py
# class ParametricNorm(Norm):
#     """Abstract base class for any parametric fuzzy norm
#     
#     @ivar p: parameter for norm
#     @type p: float
#     """
#     _range = None
# 
#     def __init__(self,type,p):
#         """Initialize type and parameter
#         
#         @param p: parameter for norm
#         @type p: float
#         """
#         super(ParametricNorm,self).__init__(type)
#         self.p = p
# 
#     @prop
#     def p():
#         """x
#         @type: float"""
#         def fget(self):
#             return self._p
#         def fset(self,value):
#             self._checkParam(value)
#             self._p = value
#         return locals()
# 
#     @prop
#     def p_range():
#         """range(s) of valid values for p"""
#         def fget(self):
#             return self._range
#         return locals()
# 
#     def _checkParam(self,value):
#         """check parameter if allowed for paramter p
#         @param value: the value to be checked 
#         @type value: float"""
#         from fuzzy.utils import checkRange
#         if not checkRange(value,self._range):
#             raise Exception("Parameter value %s is not allowed" % str(value))
# 
# Path: fuzzy/utils.py
# def prop(func):
# def checkRange(value,ranges):


from fuzzy.norm.Norm import NormException
from fuzzy.norm.ParametricNorm import ParametricNorm
from math import log
from fuzzy.utils import inf_p
# -*- coding: iso-8859-1 -*-
#
# Copyright (C) 2009  Rene Liebscher
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free 
# Software Foundation; either version 3 of the License, or (at your option) any
# later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT 
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public License along with 
# this program; if not, see <http://www.gnu.org/licenses/>. 
#

__revision__ = "$Id: FrankUnion.py,v 1.4 2009/09/24 20:32:20 rliebscher Exp $"


class FrankUnion(ParametricNorm):
    """Frank 1979"""
    
    _range = [ (0.,1.),(1.,inf_p) ]
    
    def __init__(self,p=0.5):

# Path: fuzzy/norm/Norm.py
# class NormException(Exception):
#     """Base class for any exception in norm calculations."""
#     pass
# 
# Path: fuzzy/norm/ParametricNorm.py
# class ParametricNorm(Norm):
#     """Abstract base class for any parametric fuzzy norm
#     
#     @ivar p: parameter for norm
#     @type p: float
#     """
#     _range = None
# 
#     def __init__(self,type,p):
#         """Initialize type and parameter
#         
#         @param p: parameter for norm
#         @type p: float
#         """
#         super(ParametricNorm,self).__init__(type)
#         self.p = p
# 
#     @prop
#     def p():
#         """x
#         @type: float"""
#         def fget(self):
#             return self._p
#         def fset(self,value):
#             self._checkParam(value)
#             self._p = value
#         return locals()
# 
#     @prop
#     def p_range():
#         """range(s) of valid values for p"""
#         def fget(self):
#             return self._range
#         return locals()
# 
#     def _checkParam(self,value):
#         """check parameter if allowed for paramter p
#         @param value: the value to be checked 
#         @type value: float"""
#         from fuzzy.utils import checkRange
#         if not checkRange(value,self._range):
#             raise Exception("Parameter value %s is not allowed" % str(value))
# 
# Path: fuzzy/utils.py
# def prop(func):
# def checkRange(value,ranges):


# Path: fuzzy/norm/FrankUnion.py
from fuzzy.norm.Norm import NormException
from fuzzy.norm.ParametricNorm import ParametricNorm
from math import log
from fuzzy.utils import inf_p

# -*- coding: iso-8859-1 -*-
#
# Copyright (C) 2009  Rene Liebscher
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free 
# Software Foundation; either version 3 of the License, or (at your option) any
# later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT 
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public License along with 
# this program; if not, see <http://www.gnu.org/licenses/>. 
#

__revision__ = "$Id: FrankUnion.py,v 1.4 2009/09/24 20:32:20 rliebscher Exp $"


class FrankUnion(ParametricNorm):
    """Frank 1979"""
    
    _range = [ (0.,1.),(1.,inf_p) ]
    
    def __init__(self,p=0.5):

        ParametricNorm.__init__(self,ParametricNorm.S_NORM,p)