|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Random
com.rapidminer.tools.RandomGenerator
public class RandomGenerator
The global random number generator. This should be used for all random purposes of RapidMiner to ensure that two runs of the same process setup provide the same results.
| Field Summary | |
|---|---|
static java.lang.String |
PARAMETER_LOCAL_RANDOM_SEED
|
static java.lang.String |
PARAMETER_USE_LOCAL_RANDOM_SEED
|
| Constructor Summary | |
|---|---|
RandomGenerator(long seed)
Initializes the random number generator with the given seed |
|
| Method Summary | |
|---|---|
static RandomGenerator |
getGlobalRandomGenerator()
Returns the global random number generator. |
static RandomGenerator |
getRandomGenerator(int seed)
Returns the global random number generator if the seed is negative and a new RandomGenerator with the given seed if the seed is positive or zero. |
static RandomGenerator |
getRandomGenerator(Operator operator)
This method returns the appropriate RandomGenerator for the user chosen parameter combination |
static RandomGenerator |
getRandomGenerator(Process process,
int seed)
Returns the global random number generator if the seed is negative and a new RandomGenerator with the given seed if the seed is positive or zero. |
static java.util.List<ParameterType> |
getRandomGeneratorParameters(Operator operator)
This method returns a list of parameters usable to conveniently provide parameters for random generator use within operators |
static void |
init(Process process)
Instantiates the global random number generator and initializes it with the random number generator seed specified in the global
section of the configuration file. |
java.util.Date |
nextDateInRange(java.util.Date start,
java.util.Date end)
Returns a random date between the given ones. |
double[] |
nextDoubleArray(int length)
This method returns a randomly filled array of given length |
double |
nextDoubleInRange(double lowerBound,
double upperBound)
Returns the next pseudorandom, uniformly distributed double
value between lowerBound and upperBound
from this random number generator's sequence (exclusive of the interval
endpoint values). |
int |
nextIntInRange(int lowerBound,
int upperBound)
Returns the next pseudorandom, uniformly distributed int
value between lowerBound and upperBound
from this random number generator's sequence (lower bound inclusive, upper
bound exclusive). |
java.util.Set<java.lang.Integer> |
nextIntSetWithRange(int lowerBound,
int upperBound,
int size)
Returns a set of integer within the given range and given size |
long |
nextLongInRange(long lowerBound,
long upperBound)
returns the next pseudorandom, uniformly distributed long
value between lowerBound and upperBound
from this random number generator's sequence (exclusive of the interval
endpoint values). |
java.lang.String |
nextString(int length)
Returns a random String of the given length. |
int |
randomIndex(double[] probs)
Returns a randomly selected integer between 0 and the length of the given array. |
| Methods inherited from class java.util.Random |
|---|
next, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PARAMETER_USE_LOCAL_RANDOM_SEED
public static final java.lang.String PARAMETER_LOCAL_RANDOM_SEED
| Constructor Detail |
|---|
public RandomGenerator(long seed)
seed
| Method Detail |
|---|
public static RandomGenerator getGlobalRandomGenerator()
public static RandomGenerator getRandomGenerator(int seed)
public static RandomGenerator getRandomGenerator(Process process,
int seed)
public static void init(Process process)
global
section of the configuration file. Should be invoked before the
process starts.
public static java.util.List<ParameterType> getRandomGeneratorParameters(Operator operator)
operator - the operator
public static RandomGenerator getRandomGenerator(Operator operator)
throws UndefinedParameterError
operator -
UndefinedParameterError
public double nextDoubleInRange(double lowerBound,
double upperBound)
double
value between lowerBound and upperBound
from this random number generator's sequence (exclusive of the interval
endpoint values).
public long nextLongInRange(long lowerBound,
long upperBound)
long
value between lowerBound and upperBound
from this random number generator's sequence (exclusive of the interval
endpoint values).
public int nextIntInRange(int lowerBound,
int upperBound)
int
value between lowerBound and upperBound
from this random number generator's sequence (lower bound inclusive, upper
bound exclusive).
public java.lang.String nextString(int length)
public int randomIndex(double[] probs)
public double[] nextDoubleArray(int length)
length - the length of the returned array
public java.util.Date nextDateInRange(java.util.Date start,
java.util.Date end)
public java.util.Set<java.lang.Integer> nextIntSetWithRange(int lowerBound,
int upperBound,
int size)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||