29 m_already_seeded =
true;
43 m_already_seeded =
true;
48 int d = max - min + 1;
49 return int(((
double)rand()/((
double)RAND_MAX + 1.0)) * d) + min;
83 if(empty()) createValues();
88 int ret = m_values[k];
89 m_values[k] = m_values.back();
99 int n = m_max - m_min + 1;
102 for(
int i = 0; i < n; ++i) m_values[i] = m_min + i;
109 if((
int)m_values.size() != m_max - m_min + 1) createValues();
115 DUtils::Random::UnrepeatedRandomizer::operator=
120 this->m_min = rnd.
m_min;
121 this->m_max = rnd.
m_max;
static void SeedRandOnce()
double getFloatTime() const
UnrepeatedRandomizer(int min, int max)
static bool m_already_seeded
If SeedRandOnce() or SeedRandOnce(int) have already been called.
int m_max
Max of range of values.
static int RandomInt(int min, int max)
Provides pseudo-random numbers with no repetitions.
int m_min
Min of range of values.
std::vector< int > m_values
Available values.