Learn R Programming

set6 (version 0.1.1)

FuzzySet: Mathematical Fuzzy Set

Description

A general FuzzySet object for mathematical fuzzy sets, inheriting from Set.

Value

R6 object of class FuzzySet inheriting from Set.

Constructor

FuzzySet$new(..., elements = NULL, membership = rep(1, length(elements)), class = NULL)

Constructor Arguments

Argument Type Details
... ANY Alternating elements and membership, see constructor details.
elements ANY Elements in the set, see constructor details.
membership numeric Corresponding membership of the elements, see constructor details.
class character Optional string naming a class that if supplied gives the set the typed property.

Constructor Details

FuzzySets can be constructed in one of two ways, either by supplying the elements and their membership in alternate order, or by providing a list of elements to elements and a list of respective memberships to membership, see examples. If the class argument is non-NULL, then all elements will be coerced to the given class in construction, and if elements of a different class are added these will either be rejected or coerced.

Public Fields

Field Link

class class elements elements length length lower lower upper upper max max min min range range properties properties traits traits type type

Public Methods

Fuzzy Methods Link
membership(element = NULL) membership
alphaCut(alpha, strong = FALSE, create = FALSE) alphaCut
support(create = FALSE) support
core(create = FALSE) core
inclusion(element) inclusion

Comparison Methods Link contains(x, all = FALSE, bound = NULL) contains equals(x, all = FALSE) equals isSubset(x, proper = FALSE, all = FALSE) isSubset Representation Methods Link strprint(n = 2) strprint print(n = 2) print summary(n = 2) summary

Details

Fuzzy sets generalise standard mathematical sets to allow for fuzzy relationships. Whereas a standard, or crisp, set assumes that an element is either in a set or not, a fuzzy set allows an element to be in a set 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) set is a fuzzy set where all elements have a membership equal to \(1\). Similarly to Sets, elements must be unique and the ordering does not matter, to establish order and non-unique elements, FuzzyTuples can be used.

See Also

Other sets: ConditionalSet, FuzzyTuple, Interval, Set, Tuple, UniversalSet

Examples

Run this code
# NOT RUN {
# Different constructors
FuzzySet$new(1, 0.5, 2, 1, 3, 0)
FuzzySet$new(elements = 1:3, membership = c(0.5, 1, 0))

# Crisp sets are a special case FuzzySet
# Note membership defaults to full membership
FuzzySet$new(elements = 1:5) == Set$new(1:5)

f = FuzzySet$new(1, 0.2, 2, 1, 3, 0)
f$membership()
f$alphaCut(0.3)
f$core()
f$inclusion(0)
f$membership(0)
f$membership(1)

# }

Run the code above in your browser using DataLab