Stride Reference Manual  - generated for commit 9643b11
stride::ContactHandler Class Reference

Processes the contacts between persons and determines whether transmission occurs. More...

#include <ContactHandler.h>

Collaboration diagram for stride::ContactHandler:
Collaboration graph

Public Member Functions

 ContactHandler (std::function< double()> gen)
 Constructor sets the transmission rate and random number generator. More...
 
double operator() ()
 Make a draw on the uniform generator. More...
 
bool HasContactAndTransmission (double contact_rate, double transmission_probability)
 Check if two individuals have contact and transmission. More...
 
bool HasContact (double contact_rate)
 Check if two individuals have contact. More...
 
bool HasTransmission (double transmission_probability)
 Check whether transmission occurs. More...
 

Private Member Functions

double RateToProbability (double rate)
 Convert rate into probability. More...
 

Private Attributes

std::function< double()> m_uniform01_generator
 Random number generator: double in [0.0, 1.0) More...
 

Detailed Description

Processes the contacts between persons and determines whether transmission occurs.

Definition at line 31 of file ContactHandler.h.

Constructor & Destructor Documentation

stride::ContactHandler::ContactHandler ( std::function< double()>  gen)
inlineexplicit

Constructor sets the transmission rate and random number generator.

Definition at line 35 of file ContactHandler.h.

Member Function Documentation

double stride::ContactHandler::operator() ( )
inline

Make a draw on the uniform generator.

Definition at line 38 of file ContactHandler.h.

References m_uniform01_generator.

bool stride::ContactHandler::HasContactAndTransmission ( double  contact_rate,
double  transmission_probability 
)
inline

Check if two individuals have contact and transmission.

Definition at line 41 of file ContactHandler.h.

References m_uniform01_generator, and RateToProbability().

Referenced by stride::Infector< LL, TIC, true >::Exec().

Here is the call graph for this function:

Here is the caller graph for this function:

bool stride::ContactHandler::HasContact ( double  contact_rate)
inline

Check if two individuals have contact.

Definition at line 47 of file ContactHandler.h.

References m_uniform01_generator, and RateToProbability().

Referenced by stride::Infector< LL, TIC, TO >::Exec().

Here is the call graph for this function:

Here is the caller graph for this function:

bool stride::ContactHandler::HasTransmission ( double  transmission_probability)
inline

Check whether transmission occurs.

Definition at line 50 of file ContactHandler.h.

References m_uniform01_generator.

Referenced by stride::Infector< LL, TIC, TO >::Exec().

Here is the caller graph for this function:

double stride::ContactHandler::RateToProbability ( double  rate)
inlineprivate

Convert rate into probability.

Definition at line 57 of file ContactHandler.h.

Referenced by HasContact(), and HasContactAndTransmission().

Here is the caller graph for this function:

Member Data Documentation

std::function<double()> stride::ContactHandler::m_uniform01_generator
private

Random number generator: double in [0.0, 1.0)

Definition at line 60 of file ContactHandler.h.

Referenced by HasContact(), HasContactAndTransmission(), HasTransmission(), and operator()().


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