Closed kylebaron closed 10 months ago
BUG: now doses are ignored when time is in the past. We'll fix this by skipping this time check when now is true.
now
time
true
library(mrgsolve) #> #> Attaching package: 'mrgsolve' #> The following object is masked from 'package:stats': #> #> filter code <- ' $CMT A $MAIN if(TIME==1) { mrgsolve::evdata ev(0, 1); ev.now = true; ev.amt = 100; self.mevector.push_back(ev); } ' mod <- mcode("ev", code) #> Building ev ... #> done. out <- mrgsim(mod) head(out) #> ID time A #> 1 1 0 0 #> 2 1 1 0 #> 3 1 2 0 #> 4 1 3 0 #> 5 1 4 0 #> 6 1 5 0 all(out$A==0) #> [1] TRUE
Created on 2024-01-06 with reprex v2.0.2
library(mrgsolve) #> #> Attaching package: 'mrgsolve' #> The following object is masked from 'package:stats': #> #> filter code <- ' $CMT A $MAIN if(TIME==1) { mrgsolve::evdata ev(0, 1); ev.now = true; ev.amt = 100; self.mevector.push_back(ev); } ' mod <- mcode("ev", code) #> Building ev ... #> done. out <- mrgsim(mod) head(out) #> ID time A #> 1 1 0 0 #> 2 1 1 100 #> 3 1 2 100 #> 4 1 3 100 #> 5 1 4 100 #> 6 1 5 100 all(out$A==0) #> [1] FALSE
Summary
BUG:
now
doses are ignored whentime
is in the past. We'll fix this by skipping this time check whennow
istrue
.Before fix
Created on 2024-01-06 with reprex v2.0.2
After fix
Created on 2024-01-06 with reprex v2.0.2