mrgsolve
databox_cpp.h
Go to the documentation of this file.
1 // Copyright (C) 2013 - 2020 Metrum Research Group
2 //
3 // This file is part of mrgsolve.
4 //
5 // mrgsolve is free software: you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // mrgsolve is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with mrgsolve. If not, see <http://www.gnu.org/licenses/>.
17 
18 void databox::mevent(double time, int evid) {
20  mevector.push_back(ev);
21 }
22 
23 double databox::mtime(double time) {
24  mrgsolve::evdata ev(time,2);
25  mevector.push_back(ev);
26  return time;
27 }
28 
36 double databox::tad() {
37  static double told = -1.;
38  if(newind <= 1) told = -1.0;
39  if((evid == 1) || (evid == 4)) told = time;
40  return told < 0 ? -1.0 : time - told;
41 }
databox::mevent
void mevent(double time, int evid)
constructor for evdata objects
Definition: databox_cpp.h:18
databox::time
double time
current simulation time
Definition: mrgsolv.h:92
databox::newind
unsigned int newind
new individual flag
Definition: mrgsolv.h:91
databox::tad
double tad()
calculates time after dose
Definition: databox_cpp.h:36
mrgsolve::evdata
Definition: mrgsolv.h:51
databox::mevector
std::vector< mrgsolve::evdata > mevector
a collection of model events to pass back
Definition: mrgsolv.h:107
databox::mtime
double mtime(double time)
creates evdata object for simple model event time
Definition: databox_cpp.h:23
databox::evid
int evid
event ID flag
Definition: mrgsolv.h:93