27 #ifndef Common_DiscreteRandomGenerator_h
28 #define Common_DiscreteRandomGenerator_h
140 #endif // Common_DiscreteRandomGenerator_h
void set_seed(uint32_t s)
Sets the seed for the random number generator.
uint64_t m_pool_min
Lower bound of the range.
uint64_t * m_numbers
Array with the random samples.
uint64_t m_pool_max
Upper bound of the range.
std::mt19937 m_random_engine
The random number generator.
std::shared_ptr< DiscreteRandomGenerator > DiscreteRandomGeneratorPtr
uint64_t m_value_count
Number of values in the range.
void set_pool_min(uint64_t pool_min)
Sets the lowest value of the desired distribution.
virtual double pmf(uint64_t val)
Returns the probability of drawing a specific value from the distribution.
void set_value_count(uint64_t value_count)
Sets the size of the generated range.
Generates samples from a discrete probability distribution in the range [0, max_val] by transforming ...
DiscreteRandomGenerator()
Default constructor; sets up a random number generator with a constant seed value of 1...
virtual uint64_t get_sample()
Returns a random sample from the distribution.
virtual void generate_cmf()
Generate the cumulative mass function for the distribution.
double * m_cmf
The cumulative mass of the distribution.
virtual ~DiscreteRandomGenerator()
Destructor - cleans up allocated resources.
void set_pool_max(uint64_t pool_max)
Sets the highest value of the desired distribution.