Skip to content

Commit 10bc341

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 14410df commit 10bc341

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

fuzzy_logic/fuzzy_operations.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,17 @@ def __init__(
4040

4141
def membership(self, x: float) -> float:
4242
"""
43-
Calculate the membership value of an input 'x' in the fuzzy set.
44-
Returns:
45-
float: The membership value of 'x' in the fuzzy set.
46-
"""
43+
Calculate the membership value of an input 'x' in the fuzzy set.
44+
Returns:
45+
float: The membership value of 'x' in the fuzzy set.
46+
"""
4747
if x <= self.left_boundary or x >= self.right_boundary:
4848
return 0.0
4949
elif self.left_boundary < x <= self.peak:
5050
return (x - self.left_boundary) / (self.peak - self.left_boundary)
5151
elif self.peak < x < self.right_boundary:
5252
return (self.right_boundary - x) / (self.right_boundary - self.peak)
5353

54-
5554
def union(self, other) -> "FuzzySet":
5655
"""
5756
Calculate the union of this fuzzy set with another fuzzy set.

0 commit comments

Comments
 (0)