Stride Reference Manual  1.0
stride::Person< BehaviourPolicy, BeliefPolicy > Class Template Reference

Forward declaration of class Person. More...

#include <ThresholdData.h>

Collaboration diagram for stride::Person< BehaviourPolicy, BeliefPolicy >:
Collaboration graph

Public Member Functions

 Person (unsigned int id, double age, unsigned int household_id, unsigned int school_id, unsigned int work_id, unsigned int primary_community_id, unsigned int secondary_community_id, unsigned int start_infectiousness, unsigned int start_symptomatic, unsigned int time_infectious, unsigned int time_symptomatic, double risk_averseness=0, bool is_on_vacation=false)
 Constructor: set the person data. More...
 
bool operator!= (const Person &p) const
 Is this person not equal to the given person? More...
 
double getAge () const
 Get the age. More...
 
unsigned int getClusterId (ClusterType cluster_type) const
 Get cluster ID of cluster_type. More...
 
char getGender () const
 Return person's gender. More...
 
HealthgetHealth ()
 Return person's health status. More...
 
const HealthgetHealth () const
 Return person's health status. More...
 
const BeliefPolicy::Data & getBeliefData () const
 Return person's belief status. More...
 
unsigned int getId () const
 Get the id. More...
 
bool isInCluster (ClusterType c) const
 Check if a person is present today in a given cluster. More...
 
bool isParticipatingInSurvey () const
 Does this person participates in the social contact study? More...
 
void participateInSurvey ()
 Participate in social contact study and log person details. More...
 
void update (bool is_work_off, bool is_school_off, double fraction_infected)
 Update the health status and presence in clusters. More...
 
void update (const Person *p)
 Update belief & behaviour upon meeting another Person. More...
 
bool isOnVacation () const
 
void setOnVacation (bool is_on_vacation)
 

Private Attributes

unsigned int m_id
 The id. More...
 
double m_age
 The age. More...
 
char m_gender
 The gender. More...
 
unsigned int m_household_id
 The household id. More...
 
unsigned int m_school_id
 The school cluster id. More...
 
unsigned int m_work_id
 The work cluster id. More...
 
unsigned int m_primary_community_id
 The primary community id. More...
 
unsigned int m_secondary_community_id
 The secondary community id. More...
 
bool m_at_household
 Is person present at household today? More...
 
bool m_at_school
 Is person present at school today? More...
 
bool m_at_work
 Is person present at work today? More...
 
bool m_at_primary_community
 Is person present at primary_community today? More...
 
bool m_at_secondary_community
 Is person present at secundary_community today? More...
 
Health m_health
 Health info for this person. More...
 
BeliefPolicy::Data m_belief_data
 Info w.r.t. this Person's health beliefs. More...
 
bool m_is_participant
 Is participating in the social contact study. More...
 
bool m_is_on_vacation
 Is currently on a vacation and should be included in calculations. More...
 

Friends

template<class PersonType >
class Traveller
 
class Hdf5Saver
 
class Hdf5Loader
 
class Traveller< Person< BehaviourPolicy, BeliefPolicy > >
 

Detailed Description

template<class BehaviourPolicy, class BeliefPolicy>
class stride::Person< BehaviourPolicy, BeliefPolicy >

Forward declaration of class Person.

Store and handle person data.

Definition at line 15 of file ThresholdData.h.

Constructor & Destructor Documentation

template<class BehaviourPolicy, class BeliefPolicy>
stride::Person< BehaviourPolicy, BeliefPolicy >::Person ( unsigned int  id,
double  age,
unsigned int  household_id,
unsigned int  school_id,
unsigned int  work_id,
unsigned int  primary_community_id,
unsigned int  secondary_community_id,
unsigned int  start_infectiousness,
unsigned int  start_symptomatic,
unsigned int  time_infectious,
unsigned int  time_symptomatic,
double  risk_averseness = 0,
bool  is_on_vacation = false 
)
inline

Constructor: set the person data.

Definition at line 50 of file Person.h.

References stride::Person< BehaviourPolicy, BeliefPolicy >::m_belief_data.

Member Function Documentation

template<class BehaviourPolicy, class BeliefPolicy>
bool stride::Person< BehaviourPolicy, BeliefPolicy >::operator!= ( const Person< BehaviourPolicy, BeliefPolicy > &  p) const
inline

Is this person not equal to the given person?

Definition at line 67 of file Person.h.

References stride::Person< BehaviourPolicy, BeliefPolicy >::m_id.

template<class BehaviourPolicy, class BeliefPolicy>
double stride::Person< BehaviourPolicy, BeliefPolicy >::getAge ( ) const
inline
template<class BehaviourPolicy , class BeliefPolicy >
unsigned int stride::Person< BehaviourPolicy, BeliefPolicy >::getClusterId ( ClusterType  cluster_type) const
template<class BehaviourPolicy, class BeliefPolicy>
char stride::Person< BehaviourPolicy, BeliefPolicy >::getGender ( ) const
inline

Return person's gender.

Definition at line 76 of file Person.h.

References stride::Person< BehaviourPolicy, BeliefPolicy >::m_gender.

template<class BehaviourPolicy, class BeliefPolicy>
Health& stride::Person< BehaviourPolicy, BeliefPolicy >::getHealth ( )
inline
template<class BehaviourPolicy, class BeliefPolicy>
const Health& stride::Person< BehaviourPolicy, BeliefPolicy >::getHealth ( ) const
inline

Return person's health status.

Definition at line 82 of file Person.h.

References stride::Person< BehaviourPolicy, BeliefPolicy >::m_health.

template<class BehaviourPolicy, class BeliefPolicy>
const BeliefPolicy::Data& stride::Person< BehaviourPolicy, BeliefPolicy >::getBeliefData ( ) const
inline

Return person's belief status.

Definition at line 85 of file Person.h.

References stride::Person< BehaviourPolicy, BeliefPolicy >::m_belief_data.

Referenced by stride::ThresholdData::contact().

template<class BehaviourPolicy, class BeliefPolicy>
unsigned int stride::Person< BehaviourPolicy, BeliefPolicy >::getId ( ) const
inline
template<class BehaviourPolicy , class BeliefPolicy >
bool stride::Person< BehaviourPolicy, BeliefPolicy >::isInCluster ( ClusterType  c) const

Check if a person is present today in a given cluster.

Definition at line 45 of file Person.cpp.

References stride::Household, stride::PrimaryCommunity, stride::School, stride::SecondaryCommunity, and stride::Work.

Referenced by stride::Person< BehaviourPolicy, BeliefPolicy >::getId().

template<class BehaviourPolicy, class BeliefPolicy>
bool stride::Person< BehaviourPolicy, BeliefPolicy >::isParticipatingInSurvey ( ) const
inline

Does this person participates in the social contact study?

Definition at line 94 of file Person.h.

References stride::Person< BehaviourPolicy, BeliefPolicy >::m_is_participant.

Referenced by stride::PopulationBuilder::build().

template<class BehaviourPolicy, class BeliefPolicy>
void stride::Person< BehaviourPolicy, BeliefPolicy >::participateInSurvey ( )
inline

Participate in social contact study and log person details.

Definition at line 97 of file Person.h.

References stride::Person< BehaviourPolicy, BeliefPolicy >::m_is_participant, and stride::Person< BehaviourPolicy, BeliefPolicy >::update().

Referenced by stride::PopulationBuilder::build().

template<class BehaviourPolicy , class BeliefPolicy >
void stride::Person< BehaviourPolicy, BeliefPolicy >::update ( bool  is_work_off,
bool  is_school_off,
double  fraction_infected 
)

Update the health status and presence in clusters.

Definition at line 63 of file Person.cpp.

References stride::minAdultAge().

Referenced by stride::Person< BehaviourPolicy, BeliefPolicy >::participateInSurvey().

template<class BehaviourPolicy , class BeliefPolicy >
void stride::Person< BehaviourPolicy, BeliefPolicy >::update ( const Person< BehaviourPolicy, BeliefPolicy > *  p)

Update belief & behaviour upon meeting another Person.

Definition at line 92 of file Person.cpp.

template<class BehaviourPolicy, class BeliefPolicy>
bool stride::Person< BehaviourPolicy, BeliefPolicy >::isOnVacation ( ) const
inline
template<class BehaviourPolicy, class BeliefPolicy>
void stride::Person< BehaviourPolicy, BeliefPolicy >::setOnVacation ( bool  is_on_vacation)
inline

Friends And Related Function Documentation

template<class BehaviourPolicy, class BeliefPolicy>
template<class PersonType >
friend class Traveller
friend

Definition at line 109 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
friend class Hdf5Saver
friend

Definition at line 136 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
friend class Hdf5Loader
friend

Definition at line 138 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
friend class Traveller< Person< BehaviourPolicy, BeliefPolicy > >
friend

Definition at line 140 of file Person.h.

Member Data Documentation

template<class BehaviourPolicy, class BeliefPolicy>
unsigned int stride::Person< BehaviourPolicy, BeliefPolicy >::m_id
private
template<class BehaviourPolicy, class BeliefPolicy>
double stride::Person< BehaviourPolicy, BeliefPolicy >::m_age
private

The age.

Definition at line 113 of file Person.h.

Referenced by stride::Person< BehaviourPolicy, BeliefPolicy >::getAge().

template<class BehaviourPolicy, class BeliefPolicy>
char stride::Person< BehaviourPolicy, BeliefPolicy >::m_gender
private

The gender.

Definition at line 114 of file Person.h.

Referenced by stride::Person< BehaviourPolicy, BeliefPolicy >::getGender().

template<class BehaviourPolicy, class BeliefPolicy>
unsigned int stride::Person< BehaviourPolicy, BeliefPolicy >::m_household_id
private

The household id.

Definition at line 116 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
unsigned int stride::Person< BehaviourPolicy, BeliefPolicy >::m_school_id
private

The school cluster id.

Definition at line 117 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
unsigned int stride::Person< BehaviourPolicy, BeliefPolicy >::m_work_id
private

The work cluster id.

Definition at line 118 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
unsigned int stride::Person< BehaviourPolicy, BeliefPolicy >::m_primary_community_id
private

The primary community id.

Definition at line 119 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
unsigned int stride::Person< BehaviourPolicy, BeliefPolicy >::m_secondary_community_id
private

The secondary community id.

Definition at line 120 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
bool stride::Person< BehaviourPolicy, BeliefPolicy >::m_at_household
private

Is person present at household today?

Definition at line 122 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
bool stride::Person< BehaviourPolicy, BeliefPolicy >::m_at_school
private

Is person present at school today?

Definition at line 123 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
bool stride::Person< BehaviourPolicy, BeliefPolicy >::m_at_work
private

Is person present at work today?

Definition at line 124 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
bool stride::Person< BehaviourPolicy, BeliefPolicy >::m_at_primary_community
private

Is person present at primary_community today?

Definition at line 125 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
bool stride::Person< BehaviourPolicy, BeliefPolicy >::m_at_secondary_community
private

Is person present at secundary_community today?

Definition at line 126 of file Person.h.

template<class BehaviourPolicy, class BeliefPolicy>
Health stride::Person< BehaviourPolicy, BeliefPolicy >::m_health
private

Health info for this person.

Definition at line 128 of file Person.h.

Referenced by stride::Person< BehaviourPolicy, BeliefPolicy >::getHealth().

template<class BehaviourPolicy, class BeliefPolicy>
BeliefPolicy::Data stride::Person< BehaviourPolicy, BeliefPolicy >::m_belief_data
private
template<class BehaviourPolicy, class BeliefPolicy>
bool stride::Person< BehaviourPolicy, BeliefPolicy >::m_is_participant
private
template<class BehaviourPolicy, class BeliefPolicy>
bool stride::Person< BehaviourPolicy, BeliefPolicy >::m_is_on_vacation
private

Is currently on a vacation and should be included in calculations.

Note: Population already filters these people out when iterating

Definition at line 132 of file Person.h.

Referenced by stride::Person< BehaviourPolicy, BeliefPolicy >::isOnVacation(), and stride::Person< BehaviourPolicy, BeliefPolicy >::setOnVacation().


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