FRED
|
#include <Household.h>
Public Member Functions | |
Household () | |
Household (int loc, const char *lab, double lon, double lat, Place *container, Population *pop) | |
void | get_parameters (int diseases) |
int | get_group (int disease, Person *per) |
double | get_transmission_prob (int disease, Person *i, Person *s) |
double | get_contacts_per_day (int disease) |
void | enroll (Person *per) |
void | unenroll (Person *per) |
Person * | get_housemate (int i) |
vector< Person * > | get_inhabitants () |
int | get_adults () |
int | get_children () |
bool | should_be_open (int day, int disease) |
void | record_profile () |
int | get_age_of_member (int i) |
int | get_orig_size () |
int | get_orig_id (int i) |
void | spread_infection (int day, int s) |
This class represents a household location in the FRED application. It inherits from Place
. The class contains static variables that will be filled with values from the parameter file.
Household::Household | ( | ) | [inline] |
Default constructor
Household::Household | ( | int | loc, |
const char * | lab, | ||
double | lon, | ||
double | lat, | ||
Place * | container, | ||
Population * | pop | ||
) |
Convenience constructor that sets most of the values by calling Place::setup
void Household::enroll | ( | Person * | per | ) | [virtual] |
Add a person to the household. This method increments the number of people in the household and also increments the adult or child count as appropriate.
Overrides Place::enroll(Person * per)
per | a pointer to a Person object that will be added to the household |
Reimplemented from Place.
int Household::get_adults | ( | ) | [inline] |
Get a neighborhood from the grid_cell to which this household belongs.
int Household::get_children | ( | ) | [inline] |
Get the number of children in the household.
double Household::get_contacts_per_day | ( | int | disease | ) | [virtual] |
This method returns the value from the static array Household::Household_contacts_per_day
that corresponds to a particular disease.
The static array Household_contacts_per_day
will be filled with values from the parameter file for the key household_contacts[]
.
Implements Place.
Person* Household::get_housemate | ( | int | i | ) | [inline] |
Get a person from the household.
i | the index of the person in the household |
vector<Person *> Household::get_inhabitants | ( | ) | [inline] |
Use to get list of all people in the household.
int Household::get_orig_size | ( | ) | [inline] |
void Household::get_parameters | ( | int | diseases | ) | [virtual] |
This method is called by the constructor Household(int loc, const char *lab, double lon, double lat, Place *container, Population* pop)
Implements Place.
This method returns the value from the static array Household::Household_contact_prob
that corresponds to a particular age-related value for each person.
The static array Household_contact_prob
will be filled with values from the parameter file for the key household_prob[]
.
Implements Place.
void Household::record_profile | ( | ) |
Record the ages in sorted order, and record the id's of the original members of the household
bool Household::should_be_open | ( | int | day, |
int | disease | ||
) | [inline, virtual] |
Determine if the household should be open. It is dependent on the disease and simulation day.
day | the simulation day |
disease | an integer representation of the disease |
Implements Place.
void Household::spread_infection | ( | int | day, |
int | disease_id | ||
) | [virtual] |
Attempt to spread the infection for a given diease on a given day.
day | the simulation day |
disease_id | an integer representation of the disease |
Reimplemented from Place.
void Household::unenroll | ( | Person * | per | ) | [virtual] |
Delete a person from the household. This method decrements the number of people in the household and also decrements the adult or child count as appropriate.
Overrides Place::enroll(Person * per)
per | a pointer to a Person object that will be added to the household |
Reimplemented from Place.