mrgsolve
|
#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... | |
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.
The other way would be to declare the object globally in [global]
. For example:
mrgsolve::tadose::tadose | ( | int | cmt_ | ) |
Constructor.
cmt_ | compartment number |
mrgsolve::tadose::tadose | ( | ) |
Default constructor.
void mrgsolve::tadose::reset | ( | ) |
Reset the tadose
object.
This sets had_dose
to false
and resets the time of last dose told
.
double mrgsolve::tadose::tad | ( | databox & | self | ) |
Calculate time after dose.
When self.newind <= 1
, the reset()
method is also called.
self | the model databox object |
-1
if no dose has been given int mrgsolve::tadose::cmt |
dosing compartment number to follow
bool mrgsolve::tadose::had_dose |
has the current individual received a dose yet?
double mrgsolve::tadose::told |
time of last dose