From 00b5dc535d45991b4019759147a17fd693db6b7d Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Sat, 20 Apr 2024 13:50:10 +0100 Subject: [PATCH] fixed bug with expected new cases when short range interactions are defined --- caimira/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/caimira/models.py b/caimira/models.py index 4963b80f..192a6afc 100644 --- a/caimira/models.py +++ b/caimira/models.py @@ -1812,6 +1812,12 @@ class ExposureModel: 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