FRED
Household Class Reference

#include <Household.h>

Inheritance diagram for Household:
Place

List of all members.

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)
Personget_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)

Detailed Description

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.

See also:
Place

Constructor & Destructor Documentation

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

See also:
Place::setup(int loc_id, const char *lab, double lon, double lat, Place* cont, Population *pop)

Member Function Documentation

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)

Parameters:
pera 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.

Returns:
a pointer to the neighborhood selected
See also:
Cell::select_neighborhood() Get the number of adults in the household.
Returns:
the number of adults
int Household::get_children ( ) [inline]

Get the number of children in the household.

Returns:
the number of children
double Household::get_contacts_per_day ( int  disease) [virtual]
See also:
Place::get_contacts_per_day(int disease)

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.

int Household::get_group ( int  disease,
Person per 
) [virtual]
Person* Household::get_housemate ( int  i) [inline]

Get a person from the household.

Parameters:
ithe index of the person in the household
Returns:
a pointer the person with index i in the household
vector<Person *> Household::get_inhabitants ( ) [inline]

Use to get list of all people in the household.

Returns:
vector of pointers to people in household.
int Household::get_orig_size ( ) [inline]
Returns:
the original count of agents in this Household
void Household::get_parameters ( int  diseases) [virtual]
double Household::get_transmission_prob ( int  disease,
Person i,
Person s 
) [virtual]
See also:
Place::get_transmission_prob(int disease, Person * i, Person * s)

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.

Parameters:
daythe simulation day
diseasean integer representation of the disease
Returns:
whether or not the household is open on the given day for the given 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.

Parameters:
daythe simulation day
disease_idan 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)

Parameters:
pera pointer to a Person object that will be added to the household

Reimplemented from Place.


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