java.lang.Object
io.jenetics.internal.math.Probabilities
Mathematical functions regarding probabilities.
- Since:
- 1.4
- Version:
- 7.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleValues smaller than this value are treated as zero. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisOne(double value) Returntrueif the given value can be treated as probability one.static booleanisZero(double value) Returntrueif the given value can be treated as probability zero.static floattoFloat(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 inttoInt(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
Returntrueif the given value can be treated as probability zero.- Parameters:
value- the probability value to test- Returns:
trueif the given value can be treated as probability 0- Since:
- 7.2
-
isOne
Returntrueif the given value can be treated as probability one.- Parameters:
value- the probability value to test- Returns:
trueif 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:
-