mrgsolve
Public Member Functions | Public Attributes | List of all members
mrgsolve::tadose Class Reference

#include <mrgsolve-tad.h>

Public Member Functions

 tadose (int cmt_)
 
 tadose ()
 
double tad (databox &self)
 
void reset ()
 

Public Attributes

int cmt
 dosing compartment number to follow More...
 
double told
 time of last dose More...
 
bool had_dose
 has the current individual received a dose yet? More...
 

Detailed Description

Caculate time after dose for a specific dosing compartment.

NOTE: this is in the mrgsolve namespace, so use mrg::tadose to construct these objects. You can include the header file or use the tad plugin (see examples below).

First, create a tadose object and assign a compartment number. The compartment number can be assigned in the constructor or by assigning to the cmt member. Calling the tad() method will calculate time after dose for the designated compartment. The value -1 is returned for records that occur prior to the first administered dose.

There are a couple of approaches.

First, you could create static objects in [main]. This code would give you a global variable called time_after_dose and also includes the result in the simulated output.

[ plugin ] tad
[ main ]
static mrg::tadose obj(1);
capture time_after_dose = obj.tad(self);

The other way would be to declare the object globally in [global]. For example:

[ plugin ] tad
[ global ]
[ preamble ]
obj.cmt = 2;
[ main ]
capture time_after_dose = obj.tad(self);

Constructor & Destructor Documentation

◆ tadose() [1/2]

mrgsolve::tadose::tadose ( int  cmt_)

Constructor.

Parameters
cmt_compartment number

◆ tadose() [2/2]

mrgsolve::tadose::tadose ( )

Default constructor.

Member Function Documentation

◆ reset()

void mrgsolve::tadose::reset ( )

Reset the tadose object.

This sets had_dose to false and resets the time of last dose told.

◆ tad()

double mrgsolve::tadose::tad ( databox self)

Calculate time after dose.

When self.newind <= 1, the reset() method is also called.

Parameters
selfthe model databox object
Returns
the time after dose or -1 if no dose has been given

Member Data Documentation

◆ cmt

int mrgsolve::tadose::cmt

dosing compartment number to follow

◆ had_dose

bool mrgsolve::tadose::had_dose

has the current individual received a dose yet?

◆ told

double mrgsolve::tadose::told

time of last dose


The documentation for this class was generated from the following file:
capture
double capture
Definition: housemodel-mread-header.h:21
mrgsolve::tadose
Definition: mrgsolve-tad.h:49
mrgsolve::tadose::tad
double tad(databox &self)
Definition: mrgsolve-tad.h:87
mrgsolve::tadose::cmt
int cmt
dosing compartment number to follow
Definition: mrgsolve-tad.h:51