 |
Synthia
Generic and flexible data structure generator
|
Go to the documentation of this file.
19 package ca.uqac.lif.synthia.random;
96 public void tell(Integer max)
153 int new_bound = (int) (element * magnitude);
154 if (new_bound <=
m_min)
156 new_bound =
m_min + 1;
165 return "RandomInteger [" +
m_min +
"," +
m_max +
"]";
int m_min
The lower bound of the interval.
Interface signaling that a picker can be shrunk.
Interface implemented by pickers whose picking of objects can be altered by external information.
Shrinkable< Integer > shrink(Integer o)
Miscellaneous pickers performing various functions.
static final transient RandomFloat instance
A public static instance of RandomFloat.
RandomInteger(int min, int max)
Creates a new instance of the picker.
RandomInteger()
Default constructor.
RandomInteger(int min, int max, int seed, Random random)
Protected constructor used to duplicate the picker.
RandomInteger setInterval(int min, int max)
Sets the interval in which integers are picked.
int nextInt()
Returns the next pseudorandom, uniformly distributed.
A RelativePicker that only throws a NoMoreElementException when the pick() method is called.
void reset()
Puts the picker back into its initial state.
RandomInteger setSeed(int seed)
Picks an integer uniformly in an interval.
Integer pick()
Picks a random integer.
Random Duplicate()
Creates a new instance of the class with the exact same internal states that the original one.
RandomInteger duplicate(boolean with_state)
Creates a copy of the RandomInteger picker.
Picks an object based on the value of a random number generator.
An instance of this class is used to generate a stream of pseudorandom numbers.
Picks a floating point number uniformly in an interval.
void tell(Integer max)
Sets the maximum bound for values of this picker.
Shrinkable< Integer > shrink(Integer element, Picker< Float > decision, float magnitude)
transient Random m_random
int m_max
The higher bound of the interval.