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.