This commit is contained in:
auria.mg 2018-03-28 19:45:24 -04:00
parent 0093a8eaab
commit e2645c1060
2 changed files with 4 additions and 4 deletions

View File

@ -21,17 +21,18 @@
#include <stdlib.h> #include <stdlib.h>
#include <ctime> #include <ctime>
std::vector<RandomGenerator*> RandomGenerator::m_all_random_generators; //std::vector<RandomGenerator*> RandomGenerator::m_all_random_generators;
RandomGenerator::RandomGenerator() RandomGenerator::RandomGenerator()
{ {
m_a = 1103515245; m_a = 1103515245;
m_c = 12345; m_c = 12345;
m_all_random_generators.push_back(this); //m_all_random_generators.push_back(this);
m_random_value = 3141591; m_random_value = 3141591;
} // RandomGenerator } // RandomGenerator
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if 0
std::vector<int> RandomGenerator::generateAllSeeds() std::vector<int> RandomGenerator::generateAllSeeds()
{ {
std::vector<int> all_seeds; std::vector<int> all_seeds;
@ -44,7 +45,6 @@ std::vector<int> RandomGenerator::generateAllSeeds()
return all_seeds; return all_seeds;
} // generateAllSeeds } // generateAllSeeds
#if 0
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
int RandomGenerator::get(int n) int RandomGenerator::get(int n)

View File

@ -40,7 +40,7 @@ private:
public: public:
RandomGenerator(); RandomGenerator();
std::vector<int> generateAllSeeds(); //std::vector<int> generateAllSeeds();
/** Returns a pseudo random number between 0 and n-1 inclusive */ /** Returns a pseudo random number between 0 and n-1 inclusive */
int get(int n) {return rand() % n; } int get(int n) {return rand() % n; }
void seed(int s) {m_random_value = s;} void seed(int s) {m_random_value = s;}