FuzzyNumber {FuzzyStatTraEOO} | R Documentation |
R6 Class representing a 'FuzzyNumber'.
Description
A 'FuzzyNumber' is an array of dimension nl x 3 x 1. It must be valid.
Methods
Public methods
Method new()
This method creates a valid 'FuzzyNumber' object with all its attributes set.
Usage
FuzzyNumber$new(fnLevels = NA)
Arguments
fnLevels
is an array of dimension nl x 3 x 1 (general fuzzy number). nl is the number of considered
\alpha
-levels and 3 is the number of columns of the array. The first column represents the number of considered\alpha
-levels, the second one represents their infimum values and the third and last column represents their supremum values.
Details
See examples.
Returns
The FuzzyNumber object created with all its attributes set if it is valid.
Examples
# Example 1: FuzzyNumber$new(array(c(0.0,0.5,1.0,-1.5,-1.0,-1.0,2.0,1.5,1.0),dim=c(3,3))) # Example 2: FuzzyNumber$new(array(c(0.0,1.0,1,2,4,3),dim=c(2,3)))
Method getAlphaLevels()
This method gives the 'alphaLevels' array of the 'FuzzyNumber'.
Usage
FuzzyNumber$getAlphaLevels()
Details
See examples.
Returns
The array alphaLevels of the FuzzyNumber object.
Examples
FuzzyNumber$new(array(c(0.0,0.5,1.0,-1.5,-1.0,-1.0,2.0,1.5,1.0),dim=c(3,3)) )$getAlphaLevels()
Method getInfimums()
This method gives the 'imfimums' array of the 'FuzzyNumber'.
Usage
FuzzyNumber$getInfimums()
Details
See examples.
Returns
The array imfimums of the FuzzyNumber object.
Examples
FuzzyNumber$new(array(c(0.0,0.5,1.0,-1.5,-1.0,-1.0,2.0,1.5,1.0),dim=c(3,3)) )$getInfimums()
Method getSupremums()
This method gives the 'supremums' array of the 'FuzzyNumber'.
Usage
FuzzyNumber$getSupremums()
Details
See examples.
Returns
The array supremums of the FuzzyNumber object.
Examples
FuzzyNumber$new(array(c(0.0,0.5,1.0,-1.5,-1.0,-1.0,2.0,1.5,1.0),dim=c(3,3)) )$getSupremums()
Method plot()
This method shows in a graph the values of the alphaLevels, infimums and supremums attributes of the corresponding 'FuzzyNumber'.
Usage
FuzzyNumber$plot(color = "grey")
Arguments
color
is the color of the lines representing the number to be shown in the graph. The default value is grey, other colors can be specified, the option palette() too.
Details
See examples.
Returns
a graph with the values of the alphaLevels, infimums and supremums attributes of the corresponding 'FuzzyNumber'.
Examples
# Example 1: FuzzyNumber$new(array(c(0.0,0.5,1.0,-1.5,-1.0,-1.0,2.0,1.5,1.0),dim=c(3,3)) )$plot() # Example 2: FuzzyNumber$new(array(c(0.0, 1.0, 1, 1.5, 2, 1.7),dim=c(2,3)) )$plot("blue") # Example 3: Simulation$new()$simulCase1(1L)$transfTra()$getDimension(1L)$plot(palette()) # Example 4: Simulation$new()$simulCase1(1L)$transfTra()$getDimension(1L)$plot(palette()[7])
Method clone()
The objects of this class are cloneable with this method.
Usage
FuzzyNumber$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Note
In case you find (almost surely existing) bugs or have recommendations for improving the method, comments are welcome to the above mentioned mail addresses.
Author(s)
Andrea Garcia Cernuda <uo270115@uniovi.es>
Examples
## ------------------------------------------------
## Method `FuzzyNumber$new`
## ------------------------------------------------
# Example 1:
FuzzyNumber$new(array(c(0.0,0.5,1.0,-1.5,-1.0,-1.0,2.0,1.5,1.0),dim=c(3,3)))
# Example 2:
FuzzyNumber$new(array(c(0.0,1.0,1,2,4,3),dim=c(2,3)))
## ------------------------------------------------
## Method `FuzzyNumber$getAlphaLevels`
## ------------------------------------------------
FuzzyNumber$new(array(c(0.0,0.5,1.0,-1.5,-1.0,-1.0,2.0,1.5,1.0),dim=c(3,3))
)$getAlphaLevels()
## ------------------------------------------------
## Method `FuzzyNumber$getInfimums`
## ------------------------------------------------
FuzzyNumber$new(array(c(0.0,0.5,1.0,-1.5,-1.0,-1.0,2.0,1.5,1.0),dim=c(3,3))
)$getInfimums()
## ------------------------------------------------
## Method `FuzzyNumber$getSupremums`
## ------------------------------------------------
FuzzyNumber$new(array(c(0.0,0.5,1.0,-1.5,-1.0,-1.0,2.0,1.5,1.0),dim=c(3,3))
)$getSupremums()
## ------------------------------------------------
## Method `FuzzyNumber$plot`
## ------------------------------------------------
# Example 1:
FuzzyNumber$new(array(c(0.0,0.5,1.0,-1.5,-1.0,-1.0,2.0,1.5,1.0),dim=c(3,3))
)$plot()
# Example 2:
FuzzyNumber$new(array(c(0.0, 1.0, 1, 1.5, 2, 1.7),dim=c(2,3))
)$plot("blue")
# Example 3:
Simulation$new()$simulCase1(1L)$transfTra()$getDimension(1L)$plot(palette())
# Example 4:
Simulation$new()$simulCase1(1L)$transfTra()$getDimension(1L)$plot(palette()[7])