47 void setPersonID(int64_t
id);
48 int64_t getPersonID()
const {
return m_personID; }
54 std::string
getName()
const {
return m_name; }
60 double getAgeAt(
double t0)
const {
double age = t0 - m_dateOfBirth; assert(age >= 0);
return age; }
63 bool hasDied()
const {
return ! (m_timeOfDeath < 0); }
66 void setTimeOfDeath(
double t) { assert(m_timeOfDeath < 0); m_timeOfDeath = t; }
81 double m_dateOfBirth, m_timeOfDeath;
87 class GlobalEventDummyPerson :
public PersonBase
90 GlobalEventDummyPerson() :
PersonBase(GlobalEventDummy, -11111) { }
91 ~GlobalEventDummyPerson() { }
94 #endif // PERSONBASE_H
Base class to be able to store algorithm-specific information in the PersonBase object for a person i...
Definition: populationinterfaces.h:144
The person is a man.
Definition: personbase.h:30
double getAgeAt(double t0) const
Returns the age of the person at time t0.
Definition: personbase.h:60
Gender getGender() const
Returns the gender of the person as set at construction time.
Definition: personbase.h:51
bool hasDied() const
Returns a flag indicating if the person has died.
Definition: personbase.h:63
std::string getName() const
Returns a name with which the person can be identified.
Definition: personbase.h:54
The person is a woman.
Definition: personbase.h:32
void setAlgorithmInfo(PersonAlgorithmInfo *pAlgInfo)
This is only meant to be used by the implementation of an algorithm, and allows you to store algorith...
Definition: personbase.h:74
Gender
The gender of a person.
Definition: personbase.h:27
double getDateOfBirth() const
Returns the time at which the person was born, as specified in the constructor.
Definition: personbase.h:57
PersonBase(Gender g, double dateOfBirth)
Create a new person of gender g and which was born at the specified time in the simulation.
Definition: personbase.cpp:6
This is the base class for a person in a population-based simulation.
Definition: personbase.h:23
void setTimeOfDeath(double t)
Marks the person as deceased and stores the specified time of death.
Definition: personbase.h:66
PersonAlgorithmInfo * getAlgorithmInfo() const
Returns what was stored using PersonBase::PersonAlgorithmInfo.
Definition: personbase.h:77
double getTimeOfDeath() const
Retrieves the time of death of the person, negative meaning that the person is still alive...
Definition: personbase.h:69