# Path: fuzzy/norm/Max.py
# class Max(Norm):
# 
#     def __init__(self):
#         Norm.__init__(self,Norm.S_NORM)
# 
#     def __call__(self,*args):
#         """Return maximum of given values."""
#         return max(args)
# 
# Path: fuzzy/set/Set.py
# class Set(object):
#     """Base class for all types of fuzzy sets."""
# 
#     def __call__(self,x):
#         """Return membership of x in this fuzzy set.
#            This method makes the set work like a function.
#            
#            @param x: value x
#            @type x: float
#            @return: membership for value x
#            @rtype: float
#            """
#         return 0.
# 
#     class IntervalGenerator(object):
#         def nextInterval(self,prev,next):
#             """For conversion of any set to a polygon representation.
#                Return which end value should have the interval started
#                by prev. (next is the current proposal.)
#                The membership function has to be monotonic in this interval.
#                (eg. no minima or maxima)
#                To find left start point prev is None.
#                If no further splitting at right necessary return None."""
#             return next
# 
#     def getIntervalGenerator(self):
#         """Internal helper function to help convert arbitrary fuzzy sets in 
#         fuzzy sets represented by a polygon."""
#         return self.IntervalGenerator()
# 
#     def getCOG(self):
#         """Returns center of gravity.
#            
#            @return: x-value of center of gravity
#            @rtype: float
#            """
#         #raise Exception("abtract class %s has no center of gravity." % self.__class__.__name__)
#         return 0. # XXX


from fuzzy.norm.Max import Max
from fuzzy.set.Set import Set
# 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/>. 
#
"""Describes a ... of a variable."""
__revision__ = "$Id: Adjective.py,v 1.13 2009/10/07 21:08:12 rliebscher Exp $"



class Adjective(object):
    """Describes a ... of a variable.
    
    @ivar set: fuzzy set
    @type set: L{fuzzy.set.Set.Set}
    @ivar COM: norm (if None the class default _COM is used.)
    @type COM: L{fuzzy.norm.Norm.Norm}
    @ivar membership: set or calculated membership
    @type membership: float
    @cvar _COM: class default is instance variable is None
    @type _COM: L{fuzzy.norm.Norm.Norm}
    """

    # default if not set in instance

# Path: fuzzy/norm/Max.py
# class Max(Norm):
# 
#     def __init__(self):
#         Norm.__init__(self,Norm.S_NORM)
# 
#     def __call__(self,*args):
#         """Return maximum of given values."""
#         return max(args)
# 
# Path: fuzzy/set/Set.py
# class Set(object):
#     """Base class for all types of fuzzy sets."""
# 
#     def __call__(self,x):
#         """Return membership of x in this fuzzy set.
#            This method makes the set work like a function.
#            
#            @param x: value x
#            @type x: float
#            @return: membership for value x
#            @rtype: float
#            """
#         return 0.
# 
#     class IntervalGenerator(object):
#         def nextInterval(self,prev,next):
#             """For conversion of any set to a polygon representation.
#                Return which end value should have the interval started
#                by prev. (next is the current proposal.)
#                The membership function has to be monotonic in this interval.
#                (eg. no minima or maxima)
#                To find left start point prev is None.
#                If no further splitting at right necessary return None."""
#             return next
# 
#     def getIntervalGenerator(self):
#         """Internal helper function to help convert arbitrary fuzzy sets in 
#         fuzzy sets represented by a polygon."""
#         return self.IntervalGenerator()
# 
#     def getCOG(self):
#         """Returns center of gravity.
#            
#            @return: x-value of center of gravity
#            @rtype: float
#            """
#         #raise Exception("abtract class %s has no center of gravity." % self.__class__.__name__)
#         return 0. # XXX


# Path: fuzzy/Adjective.py
from fuzzy.norm.Max import Max
from fuzzy.set.Set import Set

# 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/>. 
#
"""Describes a ... of a variable."""
__revision__ = "$Id: Adjective.py,v 1.13 2009/10/07 21:08:12 rliebscher Exp $"



class Adjective(object):
    """Describes a ... of a variable.
    
    @ivar set: fuzzy set
    @type set: L{fuzzy.set.Set.Set}
    @ivar COM: norm (if None the class default _COM is used.)
    @type COM: L{fuzzy.norm.Norm.Norm}
    @ivar membership: set or calculated membership
    @type membership: float
    @cvar _COM: class default is instance variable is None
    @type _COM: L{fuzzy.norm.Norm.Norm}
    """

    # default if not set in instance

    _COM = Max()