Skip to content

Commit

Permalink
Merge branch 'bugfix/r0_short_range' into 'master'
Browse files Browse the repository at this point in the history
Fixed bug with expected new cases when short range interactions are defined

See merge request caimira/caimira!492
  • Loading branch information
lrdossan committed Apr 21, 2024
2 parents 585dba5 + 00b5dc5 commit 477e570
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions caimira/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1812,6 +1812,12 @@ def expected_new_cases(self) -> _VectorisedFloat:
isinstance(self.exposed.number, IntPiecewiseConstant)):
raise NotImplementedError("Cannot compute expected new cases "
"with dynamic occupancy")

"""
The expect_new_cases should always take the long-range infection_probability and multiply by the occupants exposed to long-range.
"""
if self.short_range != ():
return nested_replace(self, {'short_range': ()}).infection_probability() * self.exposed.number / 100

return self.infection_probability() * self.exposed.number / 100

Expand Down

0 comments on commit 477e570

Please sign in to comment.