// __author__ = Juan Carlos De Abreu (jcabreur@gmail.com)

#include "Random.h"
#include "../../Includes/Basic.h"

BEGIN_TEG_NAMESPACE();

namespace math {

// Random constructor.
Random::Random() {
  // Seed the random-number generator with current time so that the numbers
  // will be different every time we run.
  srand((unsigned)time(NULL));
}

// Random destructor
Random::~Random() { }

// Method to generate a random number in a specific range.
double Random::generateNumber(const double& rangeMin, const double& rangeMax) {
  return (((double) rand() / (double) RAND_MAX) * rangeMax + rangeMin);
}

}; // Namespace math

END_TEG_NAMESPACE();
