MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / complement

Method complement

fuzzy_logic/fuzzy_operations.py:77–91  ·  view source on GitHub ↗

Calculate the complement (negation) of this fuzzy set. Returns: FuzzySet: A new fuzzy set representing the complement. >>> FuzzySet("fuzzy_set", 0.1, 0.2, 0.3).complement() FuzzySet(name='¬fuzzy_set', left_boundary=0.7, peak=0.9, right_boundary=0.8)

(self)

Source from the content-addressed store, hash-verified

75 )
76
77 def complement(self) -> FuzzySet:
78 """
79 Calculate the complement (negation) of this fuzzy set.
80 Returns:
81 FuzzySet: A new fuzzy set representing the complement.
82
83 >>> FuzzySet("fuzzy_set", 0.1, 0.2, 0.3).complement()
84 FuzzySet(name='¬fuzzy_set', left_boundary=0.7, peak=0.9, right_boundary=0.8)
85 """
86 return FuzzySet(
87 f"¬{self.name}",
88 1 - self.right_boundary,
89 1 - self.left_boundary,
90 1 - self.peak,
91 )
92
93 def intersection(self, other) -> FuzzySet:
94 """

Callers 1

Calls 1

FuzzySetClass · 0.85

Tested by

no test coverage detected