From 0929bfc0b003e15cd9331318ae3bde18a85f6468 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Mon, 20 Sep 2021 09:51:29 +0200 Subject: [PATCH] Changed the f_inf calculation to the InfectedPopulation class --- cara/models.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/cara/models.py b/cara/models.py index a62e73d5..2b4b66b9 100644 --- a/cara/models.py +++ b/cara/models.py @@ -669,6 +669,14 @@ class _PopulationWithVirus(Population): #: The virus with which the population is infected. virus: Virus + @method_cache + def fraction_of_infectious_virus(self) -> _VectorisedFloat: + """ + The fraction of infectious virus. + + """ + return 1. + @method_cache def emission_rate_when_present(self) -> _VectorisedFloat: """ @@ -714,8 +722,18 @@ class InfectedPopulation(_PopulationWithVirus): expiration: _ExpirationBase #: The ratio of virions that are inactivated by the infected person's immunity. + # This parameter considers the potential antibodies in the infected person, + # which might render inactive some RNA copies (virions). host_immunity: _VectorisedFloat + @method_cache + def fraction_of_infectious_virus(self) -> _VectorisedFloat: + """ + The fraction of infectious virus. + + """ + return self.virus.viable_to_RNA_ratio * (1 - self.host_immunity) + @method_cache def emission_rate_when_present(self) -> _VectorisedFloat: """ @@ -969,11 +987,12 @@ class ExposureModel: def infection_probability(self) -> _VectorisedFloat: exposure = self.exposure() + f_inf = self.concentration_model.infected.fraction_of_infectious_virus() + inf_aero = ( self.exposed.activity.inhalation_rate * (1 - self.exposed.mask.inhale_efficiency()) * - exposure * self.fraction_deposited * - (self.concentration_model.infected.virus.viable_to_RNA_ratio * (1 - self.concentration_model.infected.host_immunity)) + exposure * self.fraction_deposited * f_inf ) # Probability of infection.