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
str
__repr__(self)
Return the canonical string representation of this polygonal fuzzy number.
source code
bool
__eq__(self, other)
Return whether this polygonal fuzzy number is equal to another fuzzy number.
source code
 
mu(self, value)
Return the membership level of a value in the universal set domain of the fuzzy number.
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
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
PolygonalFuzzyNumber
to_polygonal(self)
Return this polygonal fuzzy number.
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: __and__, __iand__, __ior__, __or__, __str__

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

Static Methods [hide private]
tuple of float
_line_intersection(p, q, r, s)
Return the point of intersection of line segments pq and rs.
source code

Inherited from FuzzyNumber (private): _binary_sanity_check

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__

__repr__(self)
(Representation operator)

source code 

Return the canonical string representation of this polygonal fuzzy number.

Returns: str
Canonical string representation.
Overrides: object.__repr__

__eq__(self, other)
(Equality operator)

source code 

Return whether this polygonal fuzzy number is equal to another fuzzy number.

Parameters:
Returns: bool
True if equal.

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.

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.
Overrides: FuzzyNumber.union

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.
Overrides: FuzzyNumber.intersection

normalize(self)

source code 

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

Overrides: FuzzyNumber.normalize

to_polygonal(self)

source code 

Return this polygonal fuzzy number.

Returns: PolygonalFuzzyNumber
This polygonal fuzzy number.
Overrides: FuzzyNumber.to_polygonal

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