File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change 44import matplotlib .pyplot as plt
55import numpy as np
66
7- @dataclass
87class FuzzySet :
98 """
109 A class for representing and manipulating triangular fuzzy sets.
@@ -15,7 +14,7 @@ class FuzzySet:
1514 right_boundary : float
1615
1716 def __str__ (self ) -> str :
18- return f"{ self .name } : [{ self .left_boundary } , { self .peak } , { self .right_boundary } ]"
17+ return f"{ self .name } :[{ self .left_boundary } , { self .peak } , { self .right_boundary } ]"
1918
2019 def complement (self ) -> FuzzySet :
2120 return FuzzySet (
@@ -40,7 +39,6 @@ def membership(self, x: float) -> float:
4039 return (x - self .left_boundary ) / (self .peak - self .left_boundary )
4140 elif self .peak < x < self .right_boundary :
4241 return (self .right_boundary - x ) / (self .right_boundary - self .peak )
43-
4442 msg = f"Invalid value { x } for fuzzy set { self } "
4543 raise ValueError (msg )
4644
You can’t perform that action at this time.
0 commit comments