Learn R Programming

set6 (version 0.1.1)

FuzzyTuple: Mathematical Fuzzy Tuple

Description

A general FuzzyTuple object for mathematical fuzzy tuples, inheriting from FuzzySet.

Value

R6 object of class FuzzyTuple inheriting from FuzzySet.

Constructor

FuzzyTuple$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

FuzzyTuples 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 tuples generalise standard mathematical tuples to allow for fuzzy relationships. Whereas a standard, or crisp, tuple assumes that an element is either in a tuple or not, a fuzzy tuple allows an element to be in a tuple 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) tuple is a fuzzy tuple where all elements have a membership equal to \(1\). Similarly to Tuples, elements do not need to be unique and the ordering does matter, FuzzySets are special cases where the ordering does not matter and elements must be unique.

See Also

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

Examples

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

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

f = FuzzyTuple$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)

# Elements can be duplicated, and with different memberships,
#  although this is not necessarily sensible.
FuzzyTuple$new(1, 0.1, 1, 1)

# More important is ordering.
FuzzyTuple$new(1, 0.1, 2, 0.2) != FuzzyTuple$new(2, 0.2, 1, 0.1)
FuzzySet$new(1, 0.1, 2, 0.2) == FuzzySet$new(2, 0.2, 1, 0.1)

# }

Run the code above in your browser using DataLab