From 864d591d8be39f70598de3183b39ca8aa4e74355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Cavelan?= Date: Thu, 18 Jul 2024 10:02:11 +0200 Subject: [PATCH] fix cohort update time condition --- model/Host/Human.cpp | 2 +- model/Host/Human.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/Host/Human.cpp b/model/Host/Human.cpp index c616b580..797fe4a0 100644 --- a/model/Host/Human.cpp +++ b/model/Host/Human.cpp @@ -144,7 +144,7 @@ void Human::removeFirstEvent(interventions::SubPopRemove::RemoveAtCode code ) for( auto it = removeAtList.begin(), end = removeAtList.end(); it != end; ++it ){ auto expIt = subPopExp.find( *it ); if( expIt != subPopExp.end() ){ - if( expIt->second > sim::nowOrTs0() ){ + if( expIt->second >= sim::nowOrTs0() ){ // removeFirstEvent() is used for onFirstBout, onFirstTreatment // and onFirstInfection cohort options. Health system memory must // be reset for this to work properly; in theory the memory should diff --git a/model/Host/Human.h b/model/Host/Human.h index 800a7f08..971bac60 100644 --- a/model/Host/Human.h +++ b/model/Host/Human.h @@ -164,7 +164,7 @@ inline SimTime Human::age( SimTime time ) const { inline bool Human::isInSubPop( interventions::ComponentId id ) const { auto it = subPopExp.find( id ); if( it == subPopExp.end() ) return false; // no history of membership - else return it->second > sim::nowOrTs0(); // added: has expired? + else return it->second >= sim::nowOrTs0(); // added: has expired? } inline uint32_t Human::getCohortSet() const {