java.lang.Object
io.jenetics.internal.math.Probabilities
Mathematical functions regarding probabilities.
- Since:
- 1.4
- Version:
- 7.2
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
Values smaller than this value are treated as zero. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isOne
(double value) Returntrue
if the given value can be treated as probability one.static boolean
isZero
(double value) Returntrue
if the given value can be treated as probability zero.static float
toFloat
(int probability) Maps the integer probability, within the range[Integer.MIN_VALUE, Integer.MAX_VALUE]
back to a float probability within the range[0, 1]
.static int
toInt
(double probability) Maps the probability, given in the range[0, 1]
, to an integer in the range[Integer.MIN_VALUE, Integer.MAX_VALUE]
.
-
Field Details
-
EPSILON
Values smaller than this value are treated as zero.- Since:
- 7.2
-
-
Method Details
-
isZero
Returntrue
if the given value can be treated as probability zero.- Parameters:
value
- the probability value to test- Returns:
true
if the given value can be treated as probability 0- Since:
- 7.2
-
isOne
Returntrue
if the given value can be treated as probability one.- Parameters:
value
- the probability value to test- Returns:
true
if the given value can be treated as probability 1- Since:
- 7.2
-
toInt
Maps the probability, given in the range[0, 1]
, to an integer in the range[Integer.MIN_VALUE, Integer.MAX_VALUE]
.- Parameters:
probability
- the probability to widen.- Returns:
- the widened probability.
- See Also:
-
toFloat
Maps the integer probability, within the range[Integer.MIN_VALUE, Integer.MAX_VALUE]
back to a float probability within the range[0, 1]
.- Parameters:
probability
- the integer probability to map.- Returns:
- the mapped probability within the range
[0, 1]
. - See Also:
-