bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
bitrl::utils::maths::stats::BernoulliDist Class Reference

class BernoulliDist. Wrapper to std::bernoulli_distribution More...

#include <bernoulli_dist.h>

Public Types

typedef bool result_type
 

Public Member Functions

 BernoulliDist (real_t p=0.5)
 Constructor.
 
result_type sample () const
 Sample from the distribution.
 
result_type sample (uint_t seed) const
 Sample from the distribution.
 
std::vector< result_typesample_many (uint_t size) const
 sample from the distribution
 
std::vector< result_typesample_many (uint_t size, uint_t seed) const
 sample from the distribution
 
real_t mean () const
 The mean value of the distribution.
 
real_t variance () const
 The STD of the distribution.
 
void reset ()
 Reset the underlying distribution.
 
void reset (real_t p)
 Reset the distribution with a new p.
 

Detailed Description

class BernoulliDist. Wrapper to std::bernoulli_distribution

Member Typedef Documentation

◆ result_type

\breif The return type every time we call pdf, sample

Constructor & Destructor Documentation

◆ BernoulliDist()

bitrl::utils::maths::stats::BernoulliDist::BernoulliDist ( real_t  p = 0.5)
explicit

Constructor.

Member Function Documentation

◆ mean()

real_t bitrl::utils::maths::stats::BernoulliDist::mean ( ) const
inline

The mean value of the distribution.

◆ reset() [1/2]

void bitrl::utils::maths::stats::BernoulliDist::reset ( )
inline

Reset the underlying distribution.

◆ reset() [2/2]

void bitrl::utils::maths::stats::BernoulliDist::reset ( real_t  p)

Reset the distribution with a new p.

◆ sample() [1/2]

BernoulliDist::result_type bitrl::utils::maths::stats::BernoulliDist::sample ( ) const

Sample from the distribution.

◆ sample() [2/2]

BernoulliDist::result_type bitrl::utils::maths::stats::BernoulliDist::sample ( uint_t  seed) const

Sample from the distribution.

◆ sample_many() [1/2]

std::vector< BernoulliDist::result_type > bitrl::utils::maths::stats::BernoulliDist::sample_many ( uint_t  size) const

sample from the distribution

◆ sample_many() [2/2]

std::vector< BernoulliDist::result_type > bitrl::utils::maths::stats::BernoulliDist::sample_many ( uint_t  size,
uint_t  seed 
) const

sample from the distribution

◆ variance()

real_t bitrl::utils::maths::stats::BernoulliDist::variance ( ) const
inline

The STD of the distribution.


The documentation for this class was generated from the following files: