A general FuzzyMultiset object for mathematical fuzzy multisets, inheriting from FuzzySet.
Fuzzy multisets generalise standard mathematical multisets to allow for fuzzy relationships. Whereas a standard, or crisp, multiset assumes that an element is either in a multiset or not, a fuzzy multiset allows an element to be in a multiset to a particular degree, known as the membership function, which quantifies the inclusion of an element by a number in [0, 1]. Thus a (crisp) multiset is a fuzzy multiset where all elements have a membership equal to \(1\). Similarly to Multisets, elements do not need to be unique.
Other sets:
ConditionalSet,
FuzzySet,
FuzzyTuple,
Interval,
Multiset,
Set,
Tuple
set6::Set -> set6::FuzzySet -> FuzzyMultiset
equals()Tests if two sets are equal.
FuzzyMultiset$equals(x, all = FALSE)
Two fuzzy sets are equal if they contain the same elements with the same memberships and in the same order. Infix operators can be used for:
| Equal | == |
| Not equal | != |
If all is TRUE then returns TRUE if all x are equal to the Set, otherwise
FALSE. If all is FALSE then returns a vector of logicals corresponding to each individual
element of x.
isSubset()Test if one set is a (proper) subset of another
FuzzyMultiset$isSubset(x, proper = FALSE, all = FALSE)
xany. Object or vector of objects to test.
properlogical. If TRUE tests for proper subsets.
alllogical. If FALSE tests each x separately. Otherwise returns TRUE only if all x pass test.
If using the method directly, and not via one of the operators then the additional boolean
argument proper can be used to specify testing of subsets or proper subsets. A Set is a proper
subset of another if it is fully contained by the other Set (i.e. not equal to) whereas a Set is a
(non-proper) subset if it is fully contained by, or equal to, the other Set.
Infix operators can be used for:
| Subset | < |
| Proper Subset | <= |
| Superset | > |
| Proper Superset | >= |
If all is TRUE then returns TRUE if all x are subsets of the Set, otherwise
FALSE. If all is FALSE then returns a vector of logicals corresponding to each individual
element of x.
alphaCut()The alpha-cut of a fuzzy set is defined as the set $$A_\alpha = \{x \epsilon F | m \ge \alpha\}$$ where \(x\) is an element in the fuzzy set, \(F\), and \(m\) is the corresponding membership.
FuzzyMultiset$alphaCut(alpha, strong = FALSE, create = FALSE)
alphanumeric in [0, 1] to determine which elements to return
stronglogical, if FALSE (default) then includes elements greater than or equal to alpha, otherwise only strictly greater than
createlogical, if FALSE (default) returns the elements in the alpha cut, otherwise returns a crisp set of the elements
Elements in FuzzyMultiset or a Set of the elements.
clone()The objects of this class are cloneable with this method.
FuzzyMultiset$clone(deep = FALSE)
deepWhether to make a deep clone.
# Different constructors FuzzyMultiset$new(1, 0.5, 2, 1, 3, 0) #> (1(0.5), 2(1), 3(0)) FuzzyMultiset$new(elements = 1:3, membership = c(0.5, 1, 0)) #> (1(0.5), 2(1), 3(0)) # Crisp sets are a special case FuzzyMultiset # Note membership defaults to full membership FuzzyMultiset$new(elements = 1:5) == Multiset$new(1:5) #> [1] TRUE f <- FuzzyMultiset$new(1, 0.2, 2, 1, 3, 0) f$membership() #> $`1` #> [1] 0.2 #> #> $`2` #> [1] 1 #> #> $`3` #> [1] 0 #> f$alphaCut(0.3) #> [[1]] #> [1] 2 #> f$core() #> [[1]] #> [1] 2 #> f$inclusion(0) #> [1] "Not Included" f$membership(0) #> [1] 0 f$membership(1) #> [1] 0.2 # Elements can be duplicated, and with different memberships, # although this is not necessarily sensible. FuzzyMultiset$new(1, 0.1, 1, 1) #> (1(0.1), 1(0.1)) # Like FuzzySets, ordering does not matter. FuzzyMultiset$new(1, 0.1, 2, 0.2) == FuzzyMultiset$new(2, 0.2, 1, 0.1) #> [1] TRUE