Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RandomNumberManager Class Reference

Manager class for RandomNumbers. More...

#include <randomNumberManager.h>

Public Member Functions

 RandomNumberManager ()
 
virtual ~RandomNumberManager ()
 
void set_parameter_verboselevel (const Bridge::VerboseLevel vl)
 

Static Public Member Functions

static RandomNumbersgetInstance ()
 
static bool initialize (const std::string &rng_type, unsigned long seed)
 
static void finalize ()
 
static void reset (unsigned long seed)
 
static void restore_state (const std::string &filename)
 
static void save_state (const std::string &filename)
 
static RandomNumbersNew (const std::string &rng_type, unsigned long seed)
 

Static Public Attributes

static const std::string class_name = "RandomNumberManager"
 

Protected Attributes

Bridge::VerboseLevel m_vl
 

Private Member Functions

 RandomNumberManager (const RandomNumberManager &)
 
RandomNumberManageroperator= (const RandomNumberManager &)
 

Static Private Member Functions

static RandomNumbersfactory (const std::string &rng_type, unsigned long seed)
 

Static Private Attributes

static RandomNumberss_rand = NULL
 

Detailed Description

Manager class for RandomNumbers.

This class manages a global instance of RandomNumbers class. [7 July 2016 T.Aoyama]

Usage:

RandomNumberManager::initialize(rng_type, seed); – initialize global RNG by creating an instance of rng_type with the specified seed.

RandomNumbers* rand = RandomNumberManager::getInstance(); – fetch the global RNG. the program terminates unless initialized.

RandomNumberManager::reset(seed); – reset the state of the global RNG.

RandomNumberManager::save_state(filename); RandomNumberManager::restore_state(filename); – save/restore the state of the global RNG to/from the file.

RandomNumberManager::finalize(); – finalize the global RNG by releasing the instance.

RandomNumbers* rand = RandomNumberManager::New(rng_type, seed); – factory for RandomNumbers class. an instance of rng_type is new'ed and returned.

Definition at line 53 of file randomNumberManager.h.

Constructor & Destructor Documentation

RandomNumberManager::RandomNumberManager ( )
inline

Definition at line 63 of file randomNumberManager.h.

virtual RandomNumberManager::~RandomNumberManager ( )
inlinevirtual

Definition at line 66 of file randomNumberManager.h.

RandomNumberManager::RandomNumberManager ( const RandomNumberManager )
private

Member Function Documentation

RandomNumbers * RandomNumberManager::factory ( const std::string &  rng_type,
unsigned long  seed 
)
staticprivate

Definition at line 26 of file randomNumberManager.cpp.

void RandomNumberManager::finalize ( )
static

Definition at line 80 of file randomNumberManager.cpp.

RandomNumbers * RandomNumberManager::getInstance ( )
static

Definition at line 45 of file randomNumberManager.cpp.

bool RandomNumberManager::initialize ( const std::string &  rng_type,
unsigned long  seed 
)
static

Definition at line 57 of file randomNumberManager.cpp.

RandomNumbers * RandomNumberManager::New ( const std::string &  rng_type,
unsigned long  seed 
)
static

Definition at line 129 of file randomNumberManager.cpp.

RandomNumberManager& RandomNumberManager::operator= ( const RandomNumberManager )
private
void RandomNumberManager::reset ( unsigned long  seed)
static

Definition at line 90 of file randomNumberManager.cpp.

void RandomNumberManager::restore_state ( const std::string &  filename)
static

Definition at line 103 of file randomNumberManager.cpp.

void RandomNumberManager::save_state ( const std::string &  filename)
static

Definition at line 116 of file randomNumberManager.cpp.

void RandomNumberManager::set_parameter_verboselevel ( const Bridge::VerboseLevel  vl)
inline

Definition at line 88 of file randomNumberManager.h.

Member Data Documentation

const std::string RandomNumberManager::class_name = "RandomNumberManager"
static

Definition at line 56 of file randomNumberManager.h.

Bridge::VerboseLevel RandomNumberManager::m_vl
protected

Definition at line 59 of file randomNumberManager.h.

RandomNumbers * RandomNumberManager::s_rand = NULL
staticprivate

Definition at line 91 of file randomNumberManager.h.


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