FRED
Place Class Reference
Inheritance diagram for Place:
Classroom Hospital Household Neighborhood Office School Workplace

List of all members.

Public Member Functions

void setup (int loc_id, const char *lab, double lon, double lat, Place *cont, Population *pop)
virtual void prepare ()
void update (int day)
virtual void print (int disease_id)
virtual void enroll (Person *per)
virtual void unenroll (Person *per)
virtual void add_susceptible (int disease_id, Person *per)
virtual void add_infectious (int disease_id, Person *per)
void print_susceptibles (int disease_id)
void print_infectious (int disease_id)
virtual void spread_infection (int day, int disease_id)
bool is_open (int day)
bool is_infectious (int disease_id)
void modifyIncidenceCount (int disease_id, vector< int > strain, int incr)
void modifyPrevalenceCount (int disease_id, vector< int > strain, int incr)
void print_stats (int day, int disease_id)
virtual void get_parameters (int disease_id)=0
virtual int get_group (int disease_id, Person *per)=0
virtual double get_transmission_prob (int disease_id, Person *i, Person *s)=0
virtual double get_contacts_per_day (int disease_id)=0
virtual bool should_be_open (int day, int disease_id)=0
int get_id ()
char * get_label ()
char get_type ()
bool is_workplace ()
double get_latitude ()
double get_longitude ()
int get_S (int disease_id)
int get_I (int disease_id)
int get_symptomatic (int disease_id)
int get_size ()
int get_close_date ()
int get_open_date ()
Populationget_population ()
int get_daily_cases (int disease_id)
int get_daily_deaths (int disease_id)
int get_total_cases (int disease_id)
int get_total_deaths (int disease_id)
double get_incidence_rate (int disease_id)
void set_id (int n)
void set_type (char t)
void set_latitude (double x)
void set_longitude (double x)
void set_close_date (int day)
void set_open_date (int day)
void set_population (Population *p)
void set_container (Place *cont)
Placeget_container ()
void add_case ()
void add_deaths ()
Cellget_grid_cell ()
void set_grid_cell (Cell *p)
Placeselect_neighborhood (double community_prob, double community_distance, double local_prob)
int get_days_infectious ()
double get_attack_rate ()

Protected Member Functions

double get_contact_rate (int day, int disease_id)
int get_contact_count (Person *infector, int disease_id, int day, double contact_rate)
void attempt_transmission (double transmission_prob, Person *infector, Person *infectee, int disease_id, int day)

Protected Attributes

int id
char label [32]
char type
Placecontainer
double latitude
double longitude
int N
vector< Person * > * susceptibles
vector< Person * > * infectious
int * S
int * I
int * Sympt
int close_date
int open_date
int * cases
int * deaths
int * total_cases
int * total_deaths
Populationpopulation
Cellgrid_cell
vector< map< int, int > > incidence
vector< map< int, int > > prevalence
int days_infectious
int total_infections
double * beta

Member Function Documentation

void Place::add_case ( ) [inline]

Increment the cases count. Note that the cases variable will be reset when update() is called

void Place::add_deaths ( ) [inline]

Increment the deaths count. Note that the deaths variable will be reset when update() is called

void Place::add_infectious ( int  disease_id,
Person per 
) [virtual]

Add a infectious person to the place. This method adds the person to the infectious vector and increments the number of infectious in the place (I).

Parameters:
disease_idan integer representation of the disease
pera pointer to a Person object that will be added to the place for a given diease
void Place::add_susceptible ( int  disease_id,
Person per 
) [virtual]

Add a susceptible person to the place. This method adds the person to the susceptibles vector and increments the number of susceptibles in the place (S).

Parameters:
disease_idan integer representation of the disease
pera pointer to a Person object that will be added to the place for a given diease
void Place::enroll ( Person per) [virtual]

Add a person to the place. This method increments the number of people in the place.

Parameters:
pera pointer to a Person object that may be added to the place

Reimplemented in Classroom, Household, and School.

int Place::get_close_date ( ) [inline]

Get the simulation day (an integer value of days from the start of the simulation) when the place will close.

Returns:
the close_date
virtual double Place::get_contacts_per_day ( int  disease_id) [pure virtual]

Get the contacts for a given diease.

Parameters:
disease_idan integer representation of the disease
Returns:
the contacts per day for the given diease

Implemented in Classroom, Hospital, Household, Neighborhood, Office, School, and Workplace.

int Place::get_daily_cases ( int  disease_id) [inline]

Get the number of cases of a given diease for day. The member variable cases gets reset when update() is called, which for now is on a daily basis.

Parameters:
disease_idan integer representation of the disease
Returns:
the count of cases for a given diease
int Place::get_daily_deaths ( int  disease_id) [inline]

Get the number of deaths from a given diease for a day. The member variable deaths gets reset when update() is called, which for now is on a daily basis.

Parameters:
disease_idan integer representation of the disease
Returns:
the count of deaths for a given diease
Cell* Place::get_grid_cell ( ) [inline]

Get the grid_cell where this place is.

Returns:
a pointer to the grid_cell where this place is
virtual int Place::get_group ( int  disease_id,
Person per 
) [pure virtual]

Get the age group for a person given a particular disease_id.

Parameters:
disease_idan integer representation of the disease
pera pointer to a Person object
Returns:
the age group for the given person for the given diease

Implemented in Classroom, Hospital, Household, Neighborhood, Office, School, and Workplace.

int Place::get_I ( int  disease_id) [inline]

Get the count of (I)nfectious for a given diease in this place.

Parameters:
disease_idan integer representation of the disease
Returns:
the infectious count for the given diease
int Place::get_id ( ) [inline]

Get the id.

Returns:
the id
double Place::get_incidence_rate ( int  disease_id) [inline]

Get the number of cases of a given diease for the simulation thus far divided by the number of agents in this place.

Parameters:
disease_idan integer representation of the disease
Returns:
the count of rate of cases per people for a given diease
char* Place::get_label ( ) [inline]

Get the label.

Returns:
the label
double Place::get_latitude ( ) [inline]

Get the latitude.

Returns:
the latitude
double Place::get_longitude ( ) [inline]

Get the longitude.

Returns:
the longitude
int Place::get_open_date ( ) [inline]

Get the simulation day (an integer value of days from the start of the simulation) when the place will open.

Returns:
the open_date
virtual void Place::get_parameters ( int  disease_id) [pure virtual]

Sets the static variables for the class from the parameter file for a given number of disease_ids.

Parameters:
disease_idan integer representation of the disease

Implemented in Classroom, Hospital, Household, Neighborhood, Office, School, and Workplace.

Population* Place::get_population ( ) [inline]

Get the population.

Returns:
the population
int Place::get_S ( int  disease_id) [inline]

Get the count of (S)usceptibles for a given diease in this place.

Parameters:
disease_idan integer representation of the disease
Returns:
the suceptible count for the given diease
int Place::get_size ( ) [inline]

Get the count of agents in this place.

Returns:
the count of agents
int Place::get_symptomatic ( int  disease_id) [inline]

Get the count of (S)ymptomatics for a given diease in this place.

Parameters:
disease_idan integer representation of the disease
Returns:
the symptomatic count for the given diease
int Place::get_total_cases ( int  disease_id) [inline]

Get the number of cases of a given diease for the simulation thus far. This value is not reset when update() is called.

Parameters:
disease_idan integer representation of the disease
Returns:
the count of cases for a given diease
int Place::get_total_deaths ( int  disease_id) [inline]

Get the number of deaths from a given diease for the simulation thus far. This value is not reset when update() is called.

Parameters:
disease_idan integer representation of the disease
Returns:
the count of deaths for a given diease
virtual double Place::get_transmission_prob ( int  disease_id,
Person i,
Person s 
) [pure virtual]

Get the transmission probability for a given diease between two Person objects.

Parameters:
disease_idan integer representation of the disease
ia pointer to a Person object
sa pointer to a Person object
Returns:
the probability that there will be a transmission of disease_id from i to s

Implemented in Classroom, Hospital, Household, Neighborhood, Office, School, and Workplace.

char Place::get_type ( ) [inline]

Get the type (H)OME, (W)ORK, (S)CHOOL, (C)OMMUNITY).

Returns:
the type
bool Place::is_infectious ( int  disease_id) [inline]

Test whether or not any infectious people are in this place.

Returns:
true if any infectious people are here; false if not
bool Place::is_open ( int  day)

Is the place open on a given day?

Parameters:
daythe simulation day
Returns:
true if the place is open; false if not
void Place::modifyIncidenceCount ( int  disease_id,
vector< int >  strain,
int  incr 
)

Allow update of incidence vector.

Parameters:
disease_idan integer representation of the disease @param strain a vector of integers representing strains
incris unused at this time
void Place::modifyPrevalenceCount ( int  disease_id,
vector< int >  strain,
int  incr 
)

Allow update of prevalence vector.

Parameters:
disease_idan integer representation of the disease @param strain a vector of integers representing strains
incris unused at this time
void Place::prepare ( ) [virtual]

Get this place ready

Reimplemented in School, and Workplace.

void Place::print ( int  disease_id) [virtual]

Display the information for a given disease.

Parameters:
diseasean integer representation of the disease

Reimplemented in School.

void Place::print_infectious ( int  disease_id)

Prints the id of every person in the infectious vector for a given diease.

Parameters:
disease_idan integer representation of the disease
void Place::print_stats ( int  day,
int  disease_id 
)

<bold>Deprecated.</bold>

void Place::print_susceptibles ( int  disease_id)

Prints the id of every person in the susceptible vector for a given diease.

Parameters:
disease_idan integer representation of the disease
void Place::set_close_date ( int  day) [inline]

Set the simulation day (an integer value of days from the start of the simulation) when the place will close.

Parameters:
daythe simulation day when the place will close
void Place::set_container ( Place cont) [inline]

Set the container.

Parameters:
contthe new container
void Place::set_grid_cell ( Cell p) [inline]

Set the grid_cell where this place will be.

Parameters:
pthe new grid_cell
void Place::set_id ( int  n) [inline]

Set the id.

Parameters:
nthe new id
void Place::set_latitude ( double  x) [inline]

Set the latitude.

Parameters:
xthe new latitude
void Place::set_longitude ( double  x) [inline]

Set the longitude.

Parameters:
xthe new longitude
void Place::set_open_date ( int  day) [inline]

Set the simulation day (an integer value of days from the start of the simulation) when the place will open.

Parameters:
daythe simulation day when the place will open
void Place::set_population ( Population p) [inline]

Set the population.

Parameters:
pthe new population
void Place::set_type ( char  t) [inline]

Set the type.

Parameters:
tthe new type
void Place::setup ( int  loc_id,
const char *  lab,
double  lon,
double  lat,
Place cont,
Population pop 
)

Sets the id, label, logitude, latitude , container and population of this Place Allocates disease-related memory for this place

Parameters:
loc_idthis Place's id
labthis Place's label
lonthis Place's longitude
latthis Place's latitude
contthis Place's container
popthis Place's population
virtual bool Place::should_be_open ( int  day,
int  disease_id 
) [pure virtual]

Determine if the place should be open. It is dependent on the disease_id and simulation day.

Parameters:
daythe simulation day
disease_idan integer representation of the disease
Returns:
true if the place should be open; false if not

Implemented in Classroom, Hospital, Household, Neighborhood, Office, School, and Workplace.

void Place::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 in Household.

void Place::unenroll ( Person per) [virtual]

Remove a person from the place. This method decrements the number of people in the place.

Parameters:
pera pointer to a Person object that may be removed to the place

Reimplemented in Household, and School.

void Place::update ( int  day)

Perform a daily update of this place. The daily count arrays will all be reset and the vectors containing infectious and symptomatics will be cleared.


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