The FuzzyNumber companion object provides operations and utilities for working with fuzzy numbers, enabling probabilistic and inexact computations. It includes methods for comparison, arithmetic, and adding fuzziness to numbers.
Attributes
- Companion
- class
- Graph
-
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
FuzzyNumber.type
Members list
Type members
Classlikes
Definition of concrete (implicit) type class object for FuzzyNumber being Fuzzy.
Definition of concrete (implicit) type class object for FuzzyNumber being Fuzzy.
Attributes
- Supertypes
- Self type
-
NumberIsFuzzy.type
Inherited and Abstract types
The names of the product elements.
The names of the product elements.
Attributes
- Inherited from:
- Mirror
The name of the type.
The name of the type.
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
Method to add fuzz to a FuzzyNumber.
Method to add fuzz to a FuzzyNumber.
Value parameters
- f
-
the fuzziness to be added.
- n
-
the Number to be fuzzied.
Attributes
- Returns
-
a fuzzied version of n.
Constructs a new FuzzyNumber based on the provided nominal value, factor, and optional fuzziness. Applies specific logic to determine how fuzziness impacts the nominal value.
Constructs a new FuzzyNumber based on the provided nominal value, factor, and optional fuzziness. Applies specific logic to determine how fuzziness impacts the nominal value.
Value parameters
- factor
-
the Factor associated with the FuzzyNumber, which may influence its properties or behavior.
- fuzz
-
an optional Fuzziness[Double] representing uncertainty or variability around the nominal value. If defined, it may modify the resulting instance based on internal criteria.
- nominalValue
-
the central value of the FuzzyNumber, represented as a Value.
Attributes
- Returns
-
a new instance of FuzzyNumber that encapsulates the provided parameters and applies any necessary adjustments for fuzziness.
Method to construct an invalid Number.
Method to construct an invalid Number.
Attributes
- Returns
-
Number.apply()
For fuzzy numbers, it's appropriate to use the the normal mechanism for compare, even for NatLog numbers.
For fuzzy numbers, it's appropriate to use the the normal mechanism for compare, even for NatLog numbers.
NOTE, we first invoke same(p)(x, y) to determine if the Numbers are the same in a canonical manner. However, we could actually skip this step and always just invoke the else part of the expression.
Value parameters
- confidence
-
the probability criterion.
- x
-
the first number.
- y
-
the second number.
Attributes
- Returns
-
an Int representing the order.
Method to add a FuzzyNumber and a (general) Number.
Method to add a FuzzyNumber and a (general) Number.
Value parameters
- x
-
a FuzzyNumber.
- y
-
a Number.
Attributes
- Returns
-
the sum of x and y.
Round a Double value to the given number of significant figures, returning a String.
Round a Double value to the given number of significant figures, returning a String.
Value parameters
- sigFigs
-
the number of significant figures.
- value
-
the value to round.
Attributes
- Returns
-
a String representation rounded to sigFigs significant figures.
Calculate the appropriate number of significant figures to display given a relative tolerance. We show enough figures so the last digit is uncertain — i.e. 1 extra sig fig beyond the uncertainty.
Calculate the appropriate number of significant figures to display given a relative tolerance. We show enough figures so the last digit is uncertain — i.e. 1 extra sig fig beyond the uncertainty.
Value parameters
- tolerance
-
the relative tolerance (e.g. 0.02 for 2%).
Attributes
- Returns
-
the number of significant figures to display (minimum 1).
Method to multiply two Numbers, the first a GeneralNumber.
Method to multiply two Numbers, the first a GeneralNumber.
CONSIDER why do we have this as well as the times method in GeneralNumber? Perhaps the type of x should be FuzzyNumber.
Value parameters
- x
-
a GeneralNumber.
- y
-
a Number.
Attributes
- Returns
-
the product of x and y.