DUtils::Random::UnrepeatedRandomizer Class Reference
Provides pseudo-random numbers with no repetitions.
More...
#include <Random.h>
List of all members.
Detailed Description
Provides pseudo-random numbers with no repetitions.
Constructor & Destructor Documentation
DUtils::Random::UnrepeatedRandomizer::UnrepeatedRandomizer |
( |
int |
min, |
|
|
int |
max | |
|
) |
| | |
Creates a randomizer that returns numbers in the range [min, max]
- Parameters:
-
Copies a randomizer
- Parameters:
-
Member Function Documentation
void DUtils::Random::UnrepeatedRandomizer::createValues |
( |
|
) |
[protected] |
Creates the vector with available values
bool DUtils::Random::UnrepeatedRandomizer::empty |
( |
|
) |
const [inline] |
Returns whether all the possible values between min and max were already given. If get() is called when empty() is true, the behaviour is the same than after creating the randomizer
- Returns:
- true iff all the values were returned
int DUtils::Random::UnrepeatedRandomizer::get |
( |
|
) |
|
Returns a random number not given before. If all the possible values were already given, the process starts again
- Returns:
- unrepeated random number
unsigned int DUtils::Random::UnrepeatedRandomizer::left |
( |
|
) |
const [inline] |
Returns the number of values still to be returned
- Returns:
- amount of values to return
Copies a randomizer
- Parameters:
-
void DUtils::Random::UnrepeatedRandomizer::reset |
( |
|
) |
|
Resets the randomizer as it were just created
The documentation for this class was generated from the following files: