Package fuzz :: Module fnumber :: Class PolygonalFuzzyNumber
[hide private]
[frames] | no frames]

Class PolygonalFuzzyNumber

source code

 object --+    
          |    
FuzzyNumber --+
              |
             PolygonalFuzzyNumber

Polygonal fuzzy number class.

Instance Methods [hide private]
 
__init__(self, points)
Constructor.
source code
 
mu(self, value)
Return the membership level of a value in the universal set domain of the fuzzy number.
source code
PolygonalFuzzyNumber
__or__(self, other)
Return the standard fuzzy union of two polygonal fuzzy numbers as a new polygonal fuzzy number.
source code
PolygonalFuzzyNumber
__ior__(self, other)
In-place standard fuzzy union.
source code
PolygonalFuzzyNumber
union(self, other)
Return the standard fuzzy union of two polygonal fuzzy numbers as a new polygonal fuzzy number.
source code
PolygonalFuzzyNumber
__and__(self, other)
Return the standard fuzzy intersection of two polygonal fuzzy numbers as a new polygonal fuzzy number.
source code
PolygonalFuzzyNumber
__iand__(self, other)
In-place standard fuzzy intersection.
source code
PolygonalFuzzyNumber
intersection(self, other)
Return the standard fuzzy intersection of two polygonal fuzzy numbers as a new polygonal fuzzy number.
source code
 
normalize(self)
Normalize this fuzzy number, so that its height is equal to 1.0.
source code
fset.FuzzySet
to_fuzzy_set(self, samplepoints=None)
Convert this polygonal fuzzy number to a discrete fuzzy set at the specified sample points.
source code

Inherited from FuzzyNumber: __repr__, __str__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Static Methods [hide private]
 
_binary_sanity_check(other)
Check that the other argument to a binary operation is also a polygonal fuzzy number, raising a TypeError otherwise.
source code
tuple of float
_line_intersection(p, q, r, s)
Return the point of intersection of line segments pq and rs.
source code
Properties [hide private]
list of RealRange kernel
Return the kernel of the fuzzy number (range of values in the universal set where membership degree is equal to one).
list of RealRange support
Return the support of the fuzzy number (range of values in the universal set where membership degree is nonzero).
float height
Return the height of the fuzzy number (maximum membership degree value).

Inherited from object: __class__

Method Details [hide private]

__init__(self, points)
(Constructor)

source code 

Constructor.

Parameters:
  • points (list of tuple) - A set of points from which to generate the polygon.
Overrides: object.__init__

_binary_sanity_check(other)
Static Method

source code 

Check that the other argument to a binary operation is also a polygonal fuzzy number, raising a TypeError otherwise.

Parameters:

mu(self, value)

source code 

Return the membership level of a value in the universal set domain of the fuzzy number.

Parameters:
  • value (float) - A value in the universal set.
Overrides: FuzzyNumber.mu

_line_intersection(p, q, r, s)
Static Method

source code 

Return the point of intersection of line segments pq and rs. Helper function for union and intersection.

Returns: tuple of float
The point of intersection.

__or__(self, other)
(Or operator)

source code 

Return the standard fuzzy union of two polygonal fuzzy numbers as a new polygonal fuzzy number.

Parameters:
Returns: PolygonalFuzzyNumber
The fuzzy union.

__ior__(self, other)

source code 

In-place standard fuzzy union.

Parameters:
Returns: PolygonalFuzzyNumber
The fuzzy union (self).

union(self, other)

source code 

Return the standard fuzzy union of two polygonal fuzzy numbers as a new polygonal fuzzy number.

Parameters:
Returns: PolygonalFuzzyNumber
The fuzzy union.

__and__(self, other)
(And operator)

source code 

Return the standard fuzzy intersection of two polygonal fuzzy numbers as a new polygonal fuzzy number.

Parameters:
Returns: PolygonalFuzzyNumber
The fuzzy intersection.

__iand__(self, other)

source code 

In-place standard fuzzy intersection.

Parameters:
Returns: PolygonalFuzzyNumber
The fuzzy intersection (self).

intersection(self, other)

source code 

Return the standard fuzzy intersection of two polygonal fuzzy numbers as a new polygonal fuzzy number.

Parameters:
Returns: PolygonalFuzzyNumber
The fuzzy intersection.

normalize(self)

source code 

Normalize this fuzzy number, so that its height is equal to 1.0.

Overrides: FuzzyNumber.normalize

to_fuzzy_set(self, samplepoints=None)

source code 

Convert this polygonal fuzzy number to a discrete fuzzy set at the specified sample points. If no sample points are specified, the vertices of the polygonal fuzzy number will be used.

Parameters:
  • samplepoints (set of float) - Set of points at which to sample the number.
Returns: fset.FuzzySet
Result fuzzy set.

Property Details [hide private]

kernel

Return the kernel of the fuzzy number (range of values in the universal set where membership degree is equal to one).

Get Method:
unreachable.kernel(self) - Return the kernel of the fuzzy number (range of values in the universal set where membership degree is equal to one).
Type:
list of RealRange

support

Return the support of the fuzzy number (range of values in the universal set where membership degree is nonzero).

Get Method:
unreachable.support(self) - Return the support of the fuzzy number (range of values in the universal set where membership degree is nonzero).
Type:
list of RealRange

height

Return the height of the fuzzy number (maximum membership degree value).

Get Method:
unreachable.height(self) - Return the height of the fuzzy number (maximum membership degree value).
Type:
float