Package org.robwork.sdurw_math
Class Random
- java.lang.Object
-
- org.robwork.sdurw_math.Random
-
public class Random extends java.lang.Object
Generation of random numbers.
-
-
Constructor Summary
Constructors Constructor Description Random(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
static long
getCPtr(Random obj)
static double
ran()
A random double in the range [0, 1[ using a uniform distribution.
Note: Uses boost::randomstatic double
ran(double from, double to)
A random double in the range [from, to[ using a uniform distribution.
Note: Uses boost::randomstatic int
ranI(int from, int to)
A random integer in the range [from, to[ using a uniform distribution.
Note: Uses boost::randomstatic double
ranNormalDist(double mean, double sigma)
Returns a random sample around mean with standard deviation sigma using the
normal distribution.
Note: Uses boost::random
static void
seed()
Seeds the random number generator with current time of day
Note: Uses boost::randomstatic void
seed(long seed)
Seeds the random number generator.
Note: Uses boost::random
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(Random obj)
-
delete
public void delete()
-
ran
public static double ran()
A random double in the range [0, 1[ using a uniform distribution.
Note: Uses boost::random
-
seed
public static void seed(long seed)
Seeds the random number generator.
Note: Uses boost::random
-
seed
public static void seed()
Seeds the random number generator with current time of day
Note: Uses boost::random
-
ran
public static double ran(double from, double to)
A random double in the range [from, to[ using a uniform distribution.
Note: Uses boost::random
-
ranI
public static int ranI(int from, int to)
A random integer in the range [from, to[ using a uniform distribution.
Note: Uses boost::random
-
ranNormalDist
public static double ranNormalDist(double mean, double sigma)
Returns a random sample around mean with standard deviation sigma using the
normal distribution.
Note: Uses boost::random
- Parameters:
mean
- [in] Means valuesigma
- [in] Standard deviation- Returns:
- Random sample
-
-