1 #ifndef EVENTAIDSMORTALITY_H
3 #define EVENTAIDSMORTALITY_H
5 #include "eventmortalitybase.h"
6 #include "eventvariablefiretime.h"
9 class EventAIDSMortality :
public EventMortalityBase
12 EventAIDSMortality(Person *pPerson);
13 ~EventAIDSMortality();
15 std::string getDescription(
double tNow)
const;
16 void writeLogs(
double tNow)
const;
18 void fire(
State *pState,
double t);
22 static void obtainConfig(ConfigWriter &config);
24 static double getExpectedSurvivalTime(
const Person *pPerson);
25 static double getExpectedTimeOfDeath(
const Person *pPerson);
28 double calculateInternalTimeInterval(
const State *pState,
double t0,
double dt);
29 double solveForRealTimeInterval(
const State *pState,
double Tdiff,
double t0);
30 void checkFireTime(
double t0);
32 EventVariableFireTime_Helper m_eventHelper;
39 inline double EventAIDSMortality::getExpectedSurvivalTime(
const Person *pPerson)
42 double Vsp = pPerson->getSetPointViralLoad();
45 double tSurvival = m_C/std::pow(Vsp, -m_k);
46 assert(tSurvival > 0);
51 inline double EventAIDSMortality::getExpectedTimeOfDeath(
const Person *pPerson)
54 assert(pPerson->isInfected());
56 double expectedTimeOfDeath = getExpectedSurvivalTime(pPerson) + pPerson->getInfectionTime();
58 return expectedTimeOfDeath;
61 #endif // EVENTMORTALITY_H
This class both describes the simulation state and contains the core algorithm (as shown on the main ...
Definition: state.h:40
Helper class to read configuration settings, more advanced than ConfigReader.
Definition: configsettings.h:20
This class allows you to generate random numbers, and uses the GNU Scientific Library for this...
Definition: gslrandomnumbergenerator.h:16