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. More...

#include <personbase.h>

Inherited by GlobalEventDummyPerson.

Public Types

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

Public Member Functions

Gender getGender () const
 Returns the gender of the person as set at construction time.
 
std::string getName () const
 Returns a name with which the person can be identified.
 
double getDateOfBirth () const
 Returns the time at which the person was born, as specified in the constructor.
 
double getAgeAt (double t0) const
 Returns the age of the person at time t0.
 
bool hasDied () const
 Returns a flag indicating if the person has died.
 
void setTimeOfDeath (double t)
 Marks the person as deceased and stores the specified time of death.
 
double getTimeOfDeath () const
 Retrieves the time of death of the person, negative meaning that the person is still alive.
 
void setAlgorithmInfo (PersonAlgorithmInfo *pAlgInfo)
 This is only meant to be used by the implementation of an algorithm, and allows you to store algorithm-specific data for each person (gets deleted automatically in the destructor).
 
PersonAlgorithmInfogetAlgorithmInfo () const
 Returns what was stored using PersonBase::PersonAlgorithmInfo.
 

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.

Such a simulation uses an algorithm derived from PopulationAlgorithmInterface and a state derived from PopulationStateInterface. It is not mean to be used directly, but provides some common functions for a class which should derive from it.

Member Enumeration Documentation

◆ Gender

The gender of a person.

Enumerator
Male 

The person is a man.

Female 

The person is a woman.

Constructor & Destructor Documentation

◆ PersonBase()

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 $.


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