# 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
        self.membership = self.set(value)

    def getMembership(self):
        """Return membership set in this adjective."""
        if self.membership is None:
            return 0.0
        else:
            return self.membership

    def setMembership(self,value):
        """Set membership of this adjective as result 
           of a rule calculation, 
           if already set use COM norm to merge
           old and new value."""

        if self.membership is None:
            self.membership = value
        else:
            self.membership = (self.COM or self._COM)(
                                                    self.membership,  # consider already set value
                                                    value
                                                )

    def reset(self):
        """Reset membership to unknown value (None)."""
        self.membership = None

    def getName(self,system):
        """Find own name in given system.
        Returns a tuple (var_name,adj_name) of None."""

# 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

        self.membership = self.set(value)

    def getMembership(self):
        """Return membership set in this adjective."""
        if self.membership is None:
            return 0.0
        else:
            return self.membership

    def setMembership(self,value):
        """Set membership of this adjective as result 
           of a rule calculation, 
           if already set use COM norm to merge
           old and new value."""

        if self.membership is None:
            self.membership = value
        else:
            self.membership = (self.COM or self._COM)(
                                                    self.membership,  # consider already set value
                                                    value
                                                )

    def reset(self):
        """Reset membership to unknown value (None)."""
        self.membership = None

    def getName(self,system):
        """Find own name in given system.
        Returns a tuple (var_name,adj_name) of None."""

        return system.findAdjectiveName(self)