TrapezoidalFuzzyNumber {FuzzyStatTraEOO} | R Documentation |
R6 Class representing a 'TrapezoidalFuzzyNumber'.
Description
A 'TrapezoidalFuzzyNumber' is characterized by their four values inf0, inf1, sup1 and sup0. Its' values are checked in order to only provide a valid 'TrapezoidalFuzzyNumber'.
Methods
Public methods
Method new()
This method creates a valid 'TrapezoidalFuzzyNumber' object with all its attributes set.
Usage
TrapezoidalFuzzyNumber$new(inf0 = NA, inf1 = NA, sup1 = NA, sup0 = NA)
Arguments
inf0
is a real number that corresponds to the infimum of support of the trapezoidal fuzzy number.
inf1
is a real number that corresponds to the infimum of core of the trapezoidal fuzzy number
sup1
is a real number that corresponds to the supremum of core of the trapezoidal fuzzy numbers
sup0
is a real number that corresponds to the supremum of support of the trapezoidal fuzzy numbers
Details
See examples.
Returns
The TrapezoidalFuzzyNumber object created with all its attributes set if it is valid.
Examples
# Example 1: TrapezoidalFuzzyNumber$new(1,2,3,4) # Example 2: TrapezoidalFuzzyNumber$new(-8,-6,-4,-2) # Example 3: TrapezoidalFuzzyNumber$new(-1,-1,2,3) # Example 4: TrapezoidalFuzzyNumber$new(1,2,3,3)
Method getInf0()
This method gives the inf0 attribute of the 'TrapezoidalFuzzyNumber'.
Usage
TrapezoidalFuzzyNumber$getInf0()
Details
See examples.
Returns
The inf0 attribute of the TrapezoidalFuzzyNumber object.
Examples
TrapezoidalFuzzyNumber$new(1,2,3,4)$getInf0()
Method getInf1()
This method gives the inf1 attribute of the 'TrapezoidalFuzzyNumber'.
Usage
TrapezoidalFuzzyNumber$getInf1()
Details
See examples.
Returns
The inf1 attribute of the TrapezoidalFuzzyNumber object.
Examples
TrapezoidalFuzzyNumber$new(1,2,3,4)$getInf1()
Method getSup1()
This method gives the sup1 attribute of the 'TrapezoidalFuzzyNumber'.
Usage
TrapezoidalFuzzyNumber$getSup1()
Details
See examples.
Returns
The sup1 attribute of the TrapezoidalFuzzyNumber object.
Examples
TrapezoidalFuzzyNumber$new(1,2,3,4)$getSup1()
Method getSup0()
This method gives the sup0 attribute of the 'TrapezoidalFuzzyNumber'.
Usage
TrapezoidalFuzzyNumber$getSup0()
Details
See examples.
Returns
The sup0 attribute of the TrapezoidalFuzzyNumber object.
Examples
TrapezoidalFuzzyNumber$new(1,2,3,4)$getSup0()
Method is_positive()
This method gives information whether the 'TrapezoidalFuzzyNumber' is positive regarding its attributes.
Usage
TrapezoidalFuzzyNumber$is_positive()
Details
See examples.
Returns
TRUE whether the TrapezoidalFuzzyNumber object has all its attributes greater than -1, otherwise FALSE.
Examples
# Example 1: TrapezoidalFuzzyNumber$new(1,2,3,4)$is_positive() # Example 2: TrapezoidalFuzzyNumber$new(-8,-6,-4,-2)$is_positive()
Method plot()
This method shows in a graph the values of the corresponding 'TrapezoidalFuzzyNumber'.
Usage
TrapezoidalFuzzyNumber$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 corresponding 'TrapezoidalFuzzyNumber'.
Examples
# Example 1: TrapezoidalFuzzyNumber$new(1,2,3,4)$plot() # Example 2: TrapezoidalFuzzyNumber$new(-8,-6,-4,-2)$plot("blue") # Example 3: TrapezoidalFuzzyNumber$new(0,0,0.5,3)$plot(palette()) # Example 4: TrapezoidalFuzzyNumber$new(-8,-3.55,0,10)$plot(palette()[5])
Method clone()
The objects of this class are cloneable with this method.
Usage
TrapezoidalFuzzyNumber$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 `TrapezoidalFuzzyNumber$new`
## ------------------------------------------------
# Example 1:
TrapezoidalFuzzyNumber$new(1,2,3,4)
# Example 2:
TrapezoidalFuzzyNumber$new(-8,-6,-4,-2)
# Example 3:
TrapezoidalFuzzyNumber$new(-1,-1,2,3)
# Example 4:
TrapezoidalFuzzyNumber$new(1,2,3,3)
## ------------------------------------------------
## Method `TrapezoidalFuzzyNumber$getInf0`
## ------------------------------------------------
TrapezoidalFuzzyNumber$new(1,2,3,4)$getInf0()
## ------------------------------------------------
## Method `TrapezoidalFuzzyNumber$getInf1`
## ------------------------------------------------
TrapezoidalFuzzyNumber$new(1,2,3,4)$getInf1()
## ------------------------------------------------
## Method `TrapezoidalFuzzyNumber$getSup1`
## ------------------------------------------------
TrapezoidalFuzzyNumber$new(1,2,3,4)$getSup1()
## ------------------------------------------------
## Method `TrapezoidalFuzzyNumber$getSup0`
## ------------------------------------------------
TrapezoidalFuzzyNumber$new(1,2,3,4)$getSup0()
## ------------------------------------------------
## Method `TrapezoidalFuzzyNumber$is_positive`
## ------------------------------------------------
# Example 1:
TrapezoidalFuzzyNumber$new(1,2,3,4)$is_positive()
# Example 2:
TrapezoidalFuzzyNumber$new(-8,-6,-4,-2)$is_positive()
## ------------------------------------------------
## Method `TrapezoidalFuzzyNumber$plot`
## ------------------------------------------------
# Example 1:
TrapezoidalFuzzyNumber$new(1,2,3,4)$plot()
# Example 2:
TrapezoidalFuzzyNumber$new(-8,-6,-4,-2)$plot("blue")
# Example 3:
TrapezoidalFuzzyNumber$new(0,0,0.5,3)$plot(palette())
# Example 4:
TrapezoidalFuzzyNumber$new(-8,-3.55,0,10)$plot(palette()[5])