Skip to content

Commit f82305b

Browse files
committed
added Set.concentrated and Set.intensified but not finished
1 parent afe6f2a commit f82305b

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

fuzzy/classes.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from logging import warn
66
import pickle
77

8-
from . functions import inv, normalize
9-
from . combinators import MAX, MIN, product, bounded_sum, simple_disjoint_sum
8+
from .functions import inv, normalize
9+
from .combinators import MAX, MIN, product, bounded_sum, simple_disjoint_sum
1010

1111
class FuzzyWarning(UserWarning):
1212
pass
@@ -275,6 +275,28 @@ def relative_cardinality(self):
275275
# this is highly unlikely and only possible with res=inf but still..
276276
raise FuzzyWarning("The domain has no element.")
277277
return self.cardinality() / len(self)
278+
279+
def concentrated(self):
280+
"""
281+
Returns an new array that has a reduced amount of values the set includes and to dampen the
282+
membership of many values.
283+
TODO: implement this as a new set?
284+
"""
285+
return NotImplemented
286+
287+
return self.array ** 2
288+
289+
def intensified(self):
290+
"""
291+
Returns a new array where the membershi of values are increased that
292+
already strongly belong to the set and dampened the rest.
293+
TODO: implement this as a new set?
294+
"""
295+
return NotImplemented
296+
if x < 0.5:
297+
return 2 * x**2
298+
else:
299+
return 1 - 2(1 - x**2)
278300

279301
def plot(self):
280302
"""Graph the set.

0 commit comments

Comments
 (0)