File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -40,18 +40,17 @@ def __init__(
40
40
41
41
def membership (self , x : float ) -> float :
42
42
"""
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
+ """
47
47
if x <= self .left_boundary or x >= self .right_boundary :
48
48
return 0.0
49
49
elif self .left_boundary < x <= self .peak :
50
50
return (x - self .left_boundary ) / (self .peak - self .left_boundary )
51
51
elif self .peak < x < self .right_boundary :
52
52
return (self .right_boundary - x ) / (self .right_boundary - self .peak )
53
53
54
-
55
54
def union (self , other ) -> "FuzzySet" :
56
55
"""
57
56
Calculate the union of this fuzzy set with another fuzzy set.
You can’t perform that action at this time.
0 commit comments