mrgsolve
Loading...
Searching...
No Matches
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 = -1e9
 dosing compartment number to follow
double told = -1e9
 time of last dose
bool had_dose = false
 has the current individual received a dose yet?

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);
Definition mrgsolve-tad.h:49
double tad(databox &self)
Definition mrgsolve-tad.h:80
double capture
Definition housemodel-mread-source.cpp:25

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);
int cmt
dosing compartment number to follow
Definition mrgsolve-tad.h:51

Constructor & Destructor Documentation

◆ tadose() [1/2]

mrgsolve::tadose::tadose ( int cmt_)

Constructor.

Parameters
cmt_compartment number

◆ tadose() [2/2]

mrgsolve::tadose::tadose ( )
inline

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 = -1e9

dosing compartment number to follow

◆ had_dose

bool mrgsolve::tadose::had_dose = false

has the current individual received a dose yet?

◆ told

double mrgsolve::tadose::told = -1e9

time of last dose


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