FRED
Population Class Reference

List of all members.

Public Member Functions

 Population ()
void get_parameters ()
void setup ()
void quality_control ()
void print (int incremental=0, int day=0)
void end_of_run ()
void update (int day)
void report (int day)
Diseaseget_disease (int disease_id)
int get_pop_size ()
AV_Managerget_av_manager ()
Vaccine_Managerget_vaccine_manager ()
void add_person (Person *per)
void delete_person (Person *per)
void prepare_to_die (int day, Person *per)
void prepare_to_give_birth (int day, Person *per)
Personget_person (int n)
void set_changed (Person *p)
void assign_classrooms ()
void assign_offices ()
void get_network_stats (char *directory)
void read_population ()
void report_birth (int day, Person *per) const
void report_death (int day, Person *per) const
char * get_pstring (int id)
void print_age_distribution (char *dir, char *date_string, int run)
Personselect_random_person ()

Static Public Member Functions

static int get_next_id ()

Constructor & Destructor Documentation

Population::Population ( )

Default constructor


Member Function Documentation

void Population::add_person ( Person per)
Parameters:
pera pointer to the Person to add to the Population
void Population::assign_classrooms ( )

Assign agents in Schools to specific Classrooms within the school

void Population::assign_offices ( )

Assign agents in Workplaces to specific Offices within the workplace

void Population::delete_person ( Person per)
Parameters:
pera pointer to the Person to remove from the Population
void Population::end_of_run ( )

Perform end of run operations (clean up)

AV_Manager* Population::get_av_manager ( ) [inline]
Returns:
a pointer to this Population's AV_Manager
Disease * Population::get_disease ( int  disease_id)
Parameters:
disease_idthe index of the Disease
Returns:
a pointer to the Disease indexed by s
void Population::get_network_stats ( char *  directory)

Write degree information to a file degree.txt

Parameters:
directorythe directory where the file will be written
int Population::get_next_id ( ) [static]

Static function to get and increment the next_id

Returns:
the next id value
void Population::get_parameters ( )

Sets the static variables for the class from the parameter file.

Person* Population::get_person ( int  n) [inline]
Parameters:
nthe index of the Person Return a pointer to the Person object with index n
int Population::get_pop_size ( ) [inline]
Returns:
the pop_size
char * Population::get_pstring ( int  id)
Parameters:
idthe id of the Person
Returns:
the population string used during setup that matches the id
Vaccine_Manager* Population::get_vaccine_manager ( ) [inline]
Returns:
a pointer to this Population's Vaccine_Manager
void Population::prepare_to_die ( int  day,
Person per 
)

Perform the necessary steps for an agent's death

Parameters:
daythe simulation day
perthe agent who will die
void Population::prepare_to_give_birth ( int  day,
Person per 
)

Perform the necessary steps for an agent to give birth

Parameters:
daythe simulation day
perthe agent who will give birth
void Population::print ( int  incremental = 0,
int  day = 0 
)

Print out information about this object. This print can be adjusted to limit the output to just those agents who have changed status (0:print all, 1:incremental, -1:unchanged) with the incremental flag.

Parameters:
incrementalthe flag to adjust the agents who are actually printed out
daythe simulation day
void Population::quality_control ( )

Used during debugging to verify that code is functioning properly.

void Population::read_population ( )

Read the population from the population file

void Population::report ( int  day)

Report the disease statistics for a given day

Parameters:
daythe simulation day
void Population::report_birth ( int  day,
Person per 
) const

Print the birth information to the status file

See also:
Global::Birthfp
Parameters:
daythe simulation day
pera pointer to the Person object that has given birth
void Population::report_death ( int  day,
Person per 
) const

Print the death information to the status file

See also:
Global::Deathfp
Parameters:
daythe simulation day
pera pointer to the Person object that has died
Person * Population::select_random_person ( )
Returns:
a pointer to a random Person in this population
void Population::set_changed ( Person p)

Sets the changed flag for a Person so that the incremental print option will know that the agent has indeed changed

Parameters:
ppointer to the Person object that has changed
void Population::setup ( )

Prepare this Population (calls read_population)

See also:
Population::read_population()
void Population::update ( int  day)

Perform beginning of day operations

Parameters:
daythe simulation day

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