- java.lang.Object
-
- fr.inria.mochy.core.sampler.Sampler
-
public class Sampler extends Object
Used to generate random values for different distributions
-
-
Constructor Summary
Constructors Constructor Description Sampler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
discreteUniform(Float deb, Float end)
Sample discrete values within a given intervaldouble
gaussian(double x, float mean, double deviation)
return a gaussian value dependending of x, the mean, and the deviationfloat
gaussSampler(float average, double deviation)
int
invertTransform(int lambda)
---(1-ln(x))²*lambdafloat
invertTransformWeibull(double k, float mean)
invert repartition function of Weibull = lambda*(-log(1-x))^(1/k) repartition function of Weibull = 1-exp(-(x/lambda)^k)double
weibull(double x, int coef, double mean)
return the weibull result of the x input with the specific parameters the coef must be > 1 to have a correct shape
-
-
-
Method Detail
-
discreteUniform
public float discreteUniform(Float deb, Float end)
Sample discrete values within a given interval- Parameters:
deb
- beginning of intervalend
- end of interval- Returns:
-
invertTransform
public int invertTransform(int lambda)
---(1-ln(x))²*lambda- Parameters:
lambda
- the parameter to increase the result- Returns:
- an invertTransform value
-
weibull
public double weibull(double x, int coef, double mean)
return the weibull result of the x input with the specific parameters the coef must be > 1 to have a correct shape
-
invertTransformWeibull
public float invertTransformWeibull(double k, float mean)
invert repartition function of Weibull = lambda*(-log(1-x))^(1/k) repartition function of Weibull = 1-exp(-(x/lambda)^k)- Parameters:
k
- the shape of the function and to increase of the resultlambda
- the coefficient to increase the result- Returns:
- the value
-
gaussian
public double gaussian(double x, float mean, double deviation)
return a gaussian value dependending of x, the mean, and the deviation
-
gaussSampler
public float gaussSampler(float average, double deviation)
- Parameters:
deviation
- : the scaleaverage
- : the lowerbound value- Returns:
- a random value following the gaussian law
-
-