mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 18:49:26 +08:00
@ -57,7 +57,7 @@ class FuzzySet:
|
||||
|
||||
# Union Operations
|
||||
>>> siya.union(sheru)
|
||||
FuzzySet(name='Siya ∪ Sheru', left_boundary=0.4, peak=0.7, right_boundary=1.0)
|
||||
FuzzySet(name='Siya U Sheru', left_boundary=0.4, peak=0.7, right_boundary=1.0)
|
||||
"""
|
||||
|
||||
name: str
|
||||
@ -147,10 +147,10 @@ class FuzzySet:
|
||||
FuzzySet: A new fuzzy set representing the union.
|
||||
|
||||
>>> FuzzySet("a", 0.1, 0.2, 0.3).union(FuzzySet("b", 0.4, 0.5, 0.6))
|
||||
FuzzySet(name='a ∪ b', left_boundary=0.1, peak=0.6, right_boundary=0.35)
|
||||
FuzzySet(name='a U b', left_boundary=0.1, peak=0.6, right_boundary=0.35)
|
||||
"""
|
||||
return FuzzySet(
|
||||
f"{self.name} ∪ {other.name}",
|
||||
f"{self.name} U {other.name}",
|
||||
min(self.left_boundary, other.left_boundary),
|
||||
max(self.right_boundary, other.right_boundary),
|
||||
(self.peak + other.peak) / 2,
|
||||
|
Reference in New Issue
Block a user