Skip to content

Commit e6d8878

Browse files
authored
Merge pull request #489 from metrumresearchgroup/release/0.9.2
Release/0.9.2
2 parents 52cbe97 + d8bfe8e commit e6d8878

File tree

7 files changed

+10199
-10166
lines changed

7 files changed

+10199
-10166
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: mrgsolve
22
Type: Package
3-
Version: 0.9.1
3+
Version: 0.9.2
44
Title: Simulate from ODE-Based Models
55
Authors@R: c(
66
person("Kyle T", "Baron", email = "[email protected]", role=c("aut", "cre"), comment=c(ORCID="0000-0001-7252-5656")),

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2+
# mrgsolve 0.9.1.9000
3+
- Fix bug where system advanced to next time after advancing to steady state
4+
on a dosing record with ss=1 with no observation record at the same time
5+
but preceeding the dosing record #484
6+
- Add AMT and CMT macros for self.amt and self.cmt, respectively #354
7+
18
# mrgsolve 0.9.1
29

310
- Fix bug in TAD plugin where time of last dose never moved from default

inst/base/modelheader.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ typedef bool local_bool;
7777
#define EVID self.evid
7878
// Data set individual
7979
#define ID self.id
80+
// Data set amt
81+
#define AMT self.amt
82+
// Data set cmt
83+
# define CMT self.cmt
8084

8185

8286
// These are the fundamental macros for

inst/maintenance/unit/test-alag.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,14 @@ test_that("Error lagtime+duration >= ii for infusion", {
8484
expect_error(mrgsim(mod, ev = e))
8585
})
8686

87+
# Issue 484
88+
test_that("ss dose with lag time, different arrangements", {
89+
data1 <-
90+
ev(amt = 100,time=240,ss=1,ii=12) %>%
91+
expand_observations(c(0,seq(240,264,4)))
92+
data2 <- dplyr::arrange(data1, time, 1-evid)
93+
out1 <- mrgsim_d(mod,data1) %>% slice(-c(1,2))
94+
out2 <- mrgsim_d(mod,data2) %>% slice(-c(1,2))
95+
expect_identical(out1,out2)
96+
})
97+

src/devtran.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2013 - 2019 Metrum Research Group, LLC
1+
// Copyright (C) 2013 - 2019 Metrum Research Group
22
//
33
// This file is part of mrgsolve.
44
//
@@ -474,8 +474,7 @@ Rcpp::List DEVTRAN(const Rcpp::List parin,
474474
prob->set_d(this_rec);
475475
prob->init_call_record(tto);
476476
}
477-
478-
477+
479478
// Some non-observation event happening
480479
if(this_rec->is_event()) {
481480

@@ -496,8 +495,10 @@ Rcpp::List DEVTRAN(const Rcpp::List parin,
496495
}
497496

498497
if(prob->alag(this_cmtn) > mindt) { // there is a valid lagtime
498+
499499
if(this_rec->ss() > 0) {
500500
this_rec->steady(prob, Fn);
501+
tfrom = tto;
501502
}
502503
rec_ptr newev = NEWREC(*this_rec);
503504
newev->pos(__ALAG_POS);

0 commit comments

Comments
 (0)