Stride Reference Manual
1.0
|
The random number generator. More...
#include <Random.h>
Public Member Functions | |
Random (const unsigned long seed=0) | |
double | nextDouble () |
unsigned int | operator() (unsigned int max=std::numeric_limits< unsigned int >::max()) |
Get random unsigned int from [0, max[. More... | |
bool | hasContact (double contact_rate) |
Check if two individuals have contact. More... | |
bool | hasTransmission (double transmission_rate) |
Check if two individuals have transmission. More... | |
bool | hasContactAndTransmission (double contact_rate, double transmission_rate) |
void | setState (std::string state) |
Private Attributes | |
trng::mrg2 | m_engine |
The random number engine. More... | |
trng::uniform01_dist< double > | m_uniform_dist |
The random distribution. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Random &random) |
|
inline |
Definition at line 41 of file Random.h.
References m_engine, and m_uniform_dist.
|
inline |
Definition at line 46 of file Random.h.
References m_engine, and m_uniform_dist.
Referenced by hasContact(), hasContactAndTransmission(), hasTransmission(), and stride::PopulationBuilder::sample().
|
inline |
|
inline |
Check if two individuals have contact.
Definition at line 57 of file Random.h.
References nextDouble(), and stride::util::rateToProbability().
Referenced by stride::Infector< log_level, track_index_case, local_information_policy >::execute(), and stride::Infector< LogMode::Contacts, track_index_case, NoLocalInformation >::execute().
|
inline |
Check if two individuals have transmission.
Definition at line 62 of file Random.h.
References nextDouble(), and stride::util::rateToProbability().
Referenced by stride::Infector< log_level, track_index_case, local_information_policy >::execute(), and stride::Infector< LogMode::Contacts, track_index_case, NoLocalInformation >::execute().
|
inline |
Definition at line 66 of file Random.h.
References nextDouble(), and stride::util::rateToProbability().
Referenced by stride::Infector< log_level, track_index_case, NoLocalInformation >::execute().
|
inline |
|
friend |
|
private |
The random number engine.
Definition at line 82 of file Random.h.
Referenced by nextDouble(), operator()(), Random(), and setState().
|
private |
The random distribution.
Definition at line 83 of file Random.h.
Referenced by nextDouble(), and Random().