Package org.arakhne.afc.math.stochastic
Class StochasticGenerator
- java.lang.Object
-
- org.arakhne.afc.math.stochastic.StochasticGenerator
-
public final class StochasticGenerator extends Object
Generator of random values according to stochastic laws.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:41
- Author:
- Christophe BOHRHAUER
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathstochastic
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
generateRandomValue(StochasticLaw law)
Generate a stochastic value according to the given law.static double
noiseValue(double value, MathFunction noiseLaw)
Add a noise to the specified value.
-
-
-
Method Detail
-
generateRandomValue
@Pure public static double generateRandomValue(StochasticLaw law) throws MathException
Generate a stochastic value according to the given law.A probability
p
is randomly selected using the specified random number list. The returned value is when a randomly selected value inside the set of available values.This method uses a
uniform distribution random number generation
.- Parameters:
law
- is the stochastic law to use.- Returns:
- a value which was randomly selected according to a stochastic law.
- Throws:
MathException
- in case the value could not be computed.
-
noiseValue
@Pure public static double noiseValue(double value, MathFunction noiseLaw) throws MathException
Add a noise to the specified value.The returned value is given by:
(value-noise) < value < (value+noise)
where0 <= noise <= max(abs(value), noiseLaw(value))
. Thenoise
is randomly selected according to the given random number list.This method uses a
uniform distribution random number generation
.- Parameters:
value
- is the value to noisenoiseLaw
- is the law used to selected tyhe noise amount.- Returns:
- the value
- Throws:
MathException
- is case the value is not valid
-
-