Skip to content

Commit

Permalink
fix calls to now() that were in_update
Browse files Browse the repository at this point in the history
  • Loading branch information
acavelan committed Jul 24, 2024
1 parent 1257c0c commit 6896d55
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion model/Clinical/CMDecisionTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class CMDTUncomplicated : public CMDecisionTree {

if ( ((hostData.pgState & Episode::SICK) && !(hostData.pgState & Episode::COMPLICATED)) || (hostData.pgState & Episode::MALARIA) )
{
if (latest.time + memory >= sim::now())
if (latest.time + memory >= sim::nowOrTs0())
return positive.exec( hostData );
else
return negative.exec( hostData );
Expand Down
2 changes: 1 addition & 1 deletion model/Host/Human.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Human::Human(SimTime dateOfBirth) :
{
// Initial humans are created at time 0 and may have dateOfBirth in past. Otherwise dateOfBirth must be now.
assert( dateOfBirth == sim::nowOrTs1() || (sim::now() == sim::zero() && dateOfBirth < sim::now()) );

HumanHet het = hetSample(rng);

withinHostModel = WithinHost::WHInterface::createWithinHostModel( rng, het.comorbidityFactor );
Expand Down
3 changes: 2 additions & 1 deletion unittest/CMDecisionTreeSuite.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class CMDecisionTreeSuite : public CxxTest::TestSuite

UnittestUtil::EmpiricalWHM_setup();

human.reset( UnittestUtil::createHuman(sim::zero()).release() );
human.reset( UnittestUtil::createHuman(sim::nowOrTs0()).release() );

ETS_ASSERT( human.get() != 0 );
whm = dynamic_cast<WHMock*>(UnittestUtil::setHumanWH( *human,
unique_ptr<WithinHost::WHInterface>(new WHMock()) ));
Expand Down

0 comments on commit 6896d55

Please sign in to comment.