Skip to content

Commit

Permalink
fix cohort update time condition (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
acavelan authored Jul 18, 2024
1 parent 34ba2d8 commit 4678bbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion model/Host/Human.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion model/Host/Human.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4678bbd

Please sign in to comment.