FRED
Demographics Class Reference

List of all members.

Public Member Functions

 Demographics ()
 Demographics (Person *_self, int _age, char _sex, int _marital_status, int rel, int _profession, int day, bool is_newborn=false)
void update (int day)
double get_real_age (int day)
int get_age ()
char get_sex ()
int get_marital_status ()
int get_profession ()
bool is_pregnant ()
bool is_deceased ()
void print ()
int get_init_age ()
int get_init_marital_status ()
int get_init_profession ()
void set_relationship (int rel)
int get_relationship ()
bool is_householder ()
void terminate ()

Static Public Attributes

static const int MAX_AGE = 110
static const int MAX_PREGNANCY_AGE = 60
static const double MEAN_PREG_DAYS = 280.0
static const double STDDEV_PREG_DAYS = 7.0

Constructor & Destructor Documentation

Demographics::Demographics ( )

Default constructor

Demographics::Demographics ( Person _self,
int  _age,
char  _sex,
int  _marital_status,
int  rel,
int  _profession,
int  day,
bool  is_newborn = false 
)

Constructor that sets all of the attributes of a Demographics object

Parameters:
_selfthe Person object with which this Demographics object is associated
_age
_sex(M or F)
_marital_status1 if married, 0 if not
_professionthe code for the Person's occupation
daythe simulation day
is_newbornneeded to know how to set the date of birth

Member Function Documentation

int Demographics::get_age ( ) [inline]
Returns:
the agent's age
int Demographics::get_init_age ( ) [inline]
Returns:
the agent's init_age
int Demographics::get_init_marital_status ( ) [inline]
Returns:
the agent's init_marital_status
int Demographics::get_init_profession ( ) [inline]
Returns:
the agent's init_profession
int Demographics::get_marital_status ( ) [inline]
Returns:
the agent's marital_status
int Demographics::get_profession ( ) [inline]
Returns:
the agent's profession
double Demographics::get_real_age ( int  day)
Returns:
the number of days the agent has been alive / 365.0
char Demographics::get_sex ( ) [inline]
Returns:
the agent's sex
bool Demographics::is_deceased ( ) [inline]
Returns:
true if the agent is deceased, false otherwise
bool Demographics::is_pregnant ( ) [inline]
Returns:
true if the agent is pregnant, false otherwise
void Demographics::print ( )

Print out information about this object

void Demographics::update ( int  day)

Perform the daily update for this object

Parameters:
daythe simulation day

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