1 #ifndef HAZARDFUNCTION_H
3 #define HAZARDFUNCTION_H
25 virtual double evaluate(
double t) = 0;
41 double integrateNumerically(
double t0,
double dt);
43 static double staticEvaluationFunction(
double t,
void *pParams);
100 #define TIMELIMITEDHAZARDFUNCTION_SMALLNUMBER 1e-100
105 return (m_h.
evaluate(m_tMax) + TIMELIMITEDHAZARDFUNCTION_SMALLNUMBER)*dt;
107 if (t0 + dt <= m_tMax)
110 double tMaxMinT0 = m_tMax - t0;
113 return TdiffMax + m_h.
evaluate(m_tMax)*(dt-tMaxMinT0);
119 return Tdiff/(m_h.
evaluate(m_tMax) + TIMELIMITEDHAZARDFUNCTION_SMALLNUMBER);
121 double tMaxMinT0 = m_tMax - t0;
124 if (TdiffMax >= Tdiff)
127 return (Tdiff - TdiffMax)/m_h.
evaluate(m_tMax) + tMaxMinT0;
130 #endif // HAZARDFUNCTION_H
Abstract base class which can be used for a hazard.
Definition: hazardfunction.h:18
double solveForRealTimeInterval(double t0, double Tdiff)
For the specified internal time interval Tdiff, calculate the corresponding real-world time interval...
Definition: hazardfunction.h:116
double calculateInternalTimeInterval(double t0, double dt)
Map the real-world time dt to an internal time interval.
Definition: hazardfunction.h:102
virtual double calculateInternalTimeInterval(double t0, double dt)=0
Map the real-world time dt to an internal time interval.
virtual double solveForRealTimeInterval(double t0, double Tdiff)=0
For the specified internal time interval Tdiff, calculate the corresponding real-world time interval...
Starting from a particular hazard, this modified hazard returns a constant value for times larger tha...
Definition: hazardfunction.h:75
double evaluate(double t)
Evaluate the hazard at time t.
Definition: hazardfunction.h:92
virtual double evaluate(double t)=0
Evaluate the hazard at time t.
TimeLimitedHazardFunction(HazardFunction &h, double tMax)
This constructor specifies that the base hazard h should be used for times smaller than tMax...
Definition: hazardfunction.h:81