Simpact Cyan
Population based event driven simulation using mNRM
Public Types | Public Member Functions | Protected Member Functions | List of all members
PersonBase Class Reference

This is the base class for a person in a population-based simulation that used the Population class. More...

#include <personbase.h>

Inherits PersonalEventList.

Inherited by GlobalEventDummyPerson, and Person.

Public Types

enum  Gender { Male, Female }
 The gender of a person. More...
 

Public Member Functions

Gender getGender () const
 Returns the gender of the person as set at construction time. More...
 
std::string getName () const
 Returns a name with which the person can be identified. More...
 
double getDateOfBirth () const
 Returns the time at which the person was born, as specified in the constructor. More...
 
double getAgeAt (double t0) const
 Returns the age of the person at time t0. More...
 
bool hasDied () const
 Returns a flag indicating if the person has died. More...
 
void setTimeOfDeath (double t)
 Marks the person as deceased and stores the specified time of death. More...
 
double getTimeOfDeath () const
 Retrieves the time of death of the person, negative meaning that the person is still alive. More...
 

Protected Member Functions

 PersonBase (Gender g, double dateOfBirth)
 Create a new person of gender g and which was born at the specified time in the simulation. More...
 

Detailed Description

This is the base class for a person in a population-based simulation that used the Population class.

It is not mean to be used directly, but provides some common functions for a class which should derive from it.

Member Enumeration Documentation

The gender of a person.

Enumerator
Male 

The person is a man.

Female 

The person is a woman.

Constructor & Destructor Documentation

PersonBase::PersonBase ( Gender  g,
double  dateOfBirth 
)
protected

Create a new person of gender g and which was born at the specified time in the simulation.

Although scheduled events must always use positive times, the time describing the birth date may be negative to set a certain age of the person when the simulation starts at $ t = 0 $.

Member Function Documentation

double PersonBase::getAgeAt ( double  t0) const
inline

Returns the age of the person at time t0.

double PersonBase::getDateOfBirth ( ) const
inline

Returns the time at which the person was born, as specified in the constructor.

Gender PersonBase::getGender ( ) const
inline

Returns the gender of the person as set at construction time.

std::string PersonBase::getName ( ) const
inline

Returns a name with which the person can be identified.

double PersonBase::getTimeOfDeath ( ) const
inline

Retrieves the time of death of the person, negative meaning that the person is still alive.

bool PersonBase::hasDied ( ) const
inline

Returns a flag indicating if the person has died.

void PersonBase::setTimeOfDeath ( double  t)
inline

Marks the person as deceased and stores the specified time of death.


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