FRED
Household.h
00001 /*
00002  Copyright 2009 by the University of Pittsburgh
00003  Licensed under the Academic Free License version 3.0
00004  See the file "LICENSE" for more information
00005  */
00006 
00007 //
00008 //
00009 // File: Household.h
00010 //
00011 
00012 #ifndef _FRED_HOUSEHOLD_H
00013 #define _FRED_HOUSEHOLD_H
00014 
00015 #include "Place.h"
00016 #include "Person.h"
00017 #include "Cell.h"
00018 
00019 
00026 class Household: public Place {
00027 public: 
00028 
00032   Household() {}
00033 
00039   Household(int loc, const char *lab, double lon, double lat, Place *container, Population* pop);
00040 
00041   ~Household() {}
00042 
00049   void get_parameters(int diseases);
00050 
00054   int get_group(int disease, Person * per);
00055 
00064   double get_transmission_prob(int disease, Person * i, Person * s);
00065 
00074   double get_contacts_per_day(int disease);
00075 
00083   void enroll(Person * per);
00084 
00092   void unenroll(Person * per);
00093 
00100   Person * get_housemate(int i) { return housemate[i]; }
00101 
00106   vector <Person *> get_inhabitants() { return housemate; }
00107 
00114   // Place * select_neighborhood() { return grid_cell->select_neighborhood(); }
00115 
00120   int get_adults() { return adults; }
00121 
00126   int get_children() { return children; }
00127 
00135   bool should_be_open(int day, int disease) { return true; }
00136 
00140   void record_profile();
00141 
00142   /*
00143    * @param i the index of the agent
00144    * @return the age of the household member with index i
00145    */
00146   int get_age_of_member(int i) { return ages[i]; }
00147 
00151   int get_orig_size() { return (int) ids.size(); }
00152 
00153   /*
00154    * @param i the index of the agent
00155    * @return the id of the original household member with index i
00156    */
00157   int get_orig_id(int i) { return ids[i]; }
00158 
00159   void spread_infection(int day, int s);
00160 
00161 private:
00162   static double * Household_contacts_per_day;
00163   static double *** Household_contact_prob;
00164   static bool Household_parameters_set;
00165 
00166   vector <Person *> housemate;
00167   int children;
00168   int adults;
00169 
00170   // profile of original housemates
00171   vector <int> ages;
00172   vector <int> ids;
00173 };
00174 
00175 #endif // _FRED_HOUSEHOLD_H
00176 
 All Classes Functions