Package it.unibo.alchemist.util.math
Class Math
-
- All Implemented Interfaces:
public final class Math
-
-
Method Summary
Modifier and Type Method Description final static Double
logistic(Double sigma, Double tau, Double parameters)
Logistic function. final static Double
advancedLogistic(Double sigma, Double tau, Double parameters)
final static Double
closestTo(Double reference, Double v1, Double v2)
final static Boolean
fuzzyEquals(Double a, Double b)
Compares two double values, taking care of computing a relative error tolerance threshold. final static Boolean
fuzzyGreaterEquals(Double a, Double b)
Compares two double values, taking care of computing a relative error tolerance threshold. final static Boolean
fuzzySmallerEquals(Double a, Double b)
Compares two double values, taking care of computing a relative error tolerance threshold. -
-
Method Detail
-
logistic
final static Double logistic(Double sigma, Double tau, Double parameters)
- Parameters:
sigma
- Steepness parameter of the logistic function.tau
- Threshold parameter of the logistic function.
-
advancedLogistic
final static Double advancedLogistic(Double sigma, Double tau, Double parameters)
- Parameters:
sigma
- Steepness parameter of the advanced logistic function.tau
- Threshold parameter of the advanced logistic function.
-
closestTo
final static Double closestTo(Double reference, Double v1, Double v2)
- Parameters:
reference
- the valuev1
- first value to compare tov2
- second value to compare to- Returns:
v1 if val is closer to v1 than to v2, v2 otherwise
-
fuzzyEquals
final static Boolean fuzzyEquals(Double a, Double b)
Compares two double values, taking care of computing a relative error tolerance threshold.
- Parameters:
a
- first doubleb
- second double- Returns:
true if the double are equals with a precision order of DOUBLE_EQUALITY_EPSILON
-
fuzzyGreaterEquals
final static Boolean fuzzyGreaterEquals(Double a, Double b)
Compares two double values, taking care of computing a relative error tolerance threshold.
- Parameters:
a
- first doubleb
- second double- Returns:
true if a >= b, or if fuzzyEquals(a, b).
-
fuzzySmallerEquals
final static Boolean fuzzySmallerEquals(Double a, Double b)
Compares two double values, taking care of computing a relative error tolerance threshold.
- Parameters:
a
- first doubleb
- second double- Returns:
true if a <= b, or if fuzzyEquals(a, b).
-
-
-
-