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

Starting from a particular hazard, this modified hazard returns a constant value for times larger that a certain value. More...

#include <hazardfunction.h>

Inheritance diagram for TimeLimitedHazardFunction:
Inheritance graph
[legend]
Collaboration diagram for TimeLimitedHazardFunction:
Collaboration graph
[legend]

Public Member Functions

 TimeLimitedHazardFunction (HazardFunction &h, double tMax)
 This constructor specifies that the base hazard h should be used for times smaller than tMax, and that the constant value h(tMax) should be the hazard for times larger than tMax. More...
 
double evaluate (double t)
 Evaluate the hazard at time t. More...
 
double calculateInternalTimeInterval (double t0, double dt)
 Map the real-world time dt to an internal time interval. More...
 
double solveForRealTimeInterval (double t0, double Tdiff)
 For the specified internal time interval Tdiff, calculate the corresponding real-world time interval. More...
 

Detailed Description

Starting from a particular hazard, this modified hazard returns a constant value for times larger that a certain value.

The advantage of this, is that hazards which could not be used in the mNRM because a mapping of internal time dT to real-world time dt was impossible, now become useable.

For example, if the hazard $h(s) = exp(-s) $ is used, there's a problem for the mNRM: in this algorithm, a random number $ dT $ is first picked and then mapped onto a real-world time by solving the following equation for $ dt $:

\[ dT = \int_{t_0}^{t_0 + dt} h(s) ds \]

Now, the integral of $ h(s) $ is bounded, with

\[ \int_0^{\infty} h(s) ds = 1 \]

Because $ dT $ can easily be larger than one, this means that calculating the corresponding $ dt $ value by solving the integral equation above, may simply not be possible.

By using a modified hazard $ g(s) $ instead, where

\[ g(t) = \left\{ \begin{array}{ll} h(t) & {\rm if\ } t < t_{max} \\ h(t_{max}) & {\rm if\ } t \ge t_{max} \end{array} \right. \]

this integral becomes solvable again.

For more information, some calculations can be found in hazard_tmax.pdf

Constructor & Destructor Documentation

TimeLimitedHazardFunction::TimeLimitedHazardFunction ( HazardFunction h,
double  tMax 
)
inline

This constructor specifies that the base hazard h should be used for times smaller than tMax, and that the constant value h(tMax) should be the hazard for times larger than tMax.

Member Function Documentation

double TimeLimitedHazardFunction::calculateInternalTimeInterval ( double  t0,
double  dt 
)
inlinevirtual

Map the real-world time dt to an internal time interval.

This calculates:

\[ dT = \int_{t_0}^{t_0 + dt} h(s) ds \]

Implements HazardFunction.

double TimeLimitedHazardFunction::evaluate ( double  t)
inlinevirtual

Evaluate the hazard at time t.

Implements HazardFunction.

double TimeLimitedHazardFunction::solveForRealTimeInterval ( double  t0,
double  Tdiff 
)
inlinevirtual

For the specified internal time interval Tdiff, calculate the corresponding real-world time interval.

This solves the following equation for $ dt $:

\[ Tdiff = \int_{t_0}^{t_0 + dt} h(s) ds \]

Implements HazardFunction.


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