6#include "ns3/random-variable-stream.h"
7#include "ns3/rng-seed-manager.h"
13#include <gsl/gsl_cdf.h>
14#include <gsl/gsl_histogram.h>
41 double increment = (end - start) / (n - 1.);
77 void DoRun()
override;
81 :
TestCase(
"Uniform Random Number Generator")
170 void DoRun()
override;
174 :
TestCase(
"Normal Random Number Generator")
189 range[0] = -std::numeric_limits<double>::max();
190 range[
N_BINS] = std::numeric_limits<double>::max();
277 void DoRun()
override;
281 :
TestCase(
"Exponential Random Number Generator")
296 range[
N_BINS] = std::numeric_limits<double>::max();
383 void DoRun()
override;
387 :
TestCase(
"Pareto Random Number Generator")
402 range[
N_BINS] = std::numeric_limits<double>::max();
409 double b = 0.33333333;
Test case for exponential distribution random number generator.
~RngExponentialTestCase() override
static const uint32_t N_BINS
Number of bins.
void DoRun() override
Implementation to actually run this TestCase.
static const uint32_t N_MEASUREMENTS
Number of measurements.
double ChiSquaredTest(Ptr< ExponentialRandomVariable > n)
Run a chi-squared test on the results of the random number generator.
static const uint32_t N_RUNS
Number of runs.
Test case for normal distribution random number generator.
~RngNormalTestCase() override
double ChiSquaredTest(Ptr< NormalRandomVariable > n)
Run a chi-squared test on the results of the random number generator.
static const uint32_t N_MEASUREMENTS
Number of measurements.
static const uint32_t N_RUNS
Number of runs.
void DoRun() override
Implementation to actually run this TestCase.
static const uint32_t N_BINS
Number of bins.
Test case for pareto distribution random number generator.
static const uint32_t N_RUNS
Number of runs.
~RngParetoTestCase() override
double ChiSquaredTest(Ptr< ParetoRandomVariable > p)
Run a chi-squared test on the results of the random number generator.
void DoRun() override
Implementation to actually run this TestCase.
static const uint32_t N_BINS
Number of bins.
static const uint32_t N_MEASUREMENTS
Number of measurements.
The random number generators Test Suite.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Smart pointer class similar to boost::intrusive_ptr.
static void SetSeed(uint32_t seed)
Set the seed.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
void FillHistoRangeUniformly(double *array, uint32_t n, double start, double end)
Fill an array with increasing values, in the [start, end] range.
#define NS_TEST_ASSERT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report and abort if not.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static RngTestSuite g_rngTestSuite
Static variable for test initialization.