added shouting model and changed talking to speaking
This commit is contained in:
parent
57b6a668c0
commit
f0c59b0c61
3 changed files with 52 additions and 12 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from cara import models
|
||||
from cara.monte_carlo.data import activity_distributions, virus_distributions
|
||||
from cara.monte_carlo.data import activity_distributions, symptomatic_vl_frequencies
|
||||
import cara.monte_carlo as mc
|
||||
import numpy as np
|
||||
|
||||
|
|
@ -39,7 +39,10 @@ def breathing_exposure():
|
|||
),
|
||||
infected=mc.InfectedPopulation(
|
||||
number=1,
|
||||
virus=virus_distributions['SARS_CoV_2'],
|
||||
virus=models.Virus(
|
||||
viral_load_in_sputum=symptomatic_vl_frequencies,
|
||||
infectious_dose=50.,
|
||||
),
|
||||
presence=mc.SpecificInterval(((0, 2),)),
|
||||
mask=models.Mask.types["No mask"],
|
||||
activity=activity_distributions['Seated'],
|
||||
|
|
@ -55,8 +58,8 @@ def breathing_exposure():
|
|||
)
|
||||
return exposure_mc
|
||||
|
||||
######### Talking model ###########
|
||||
def talking_exposure():
|
||||
######### Speaking model ###########
|
||||
def speaking_exposure():
|
||||
exposure_mc = mc.ExposureModel(
|
||||
concentration_model=mc.ConcentrationModel(
|
||||
room=models.Room(volume=100, humidity=0.5),
|
||||
|
|
@ -66,7 +69,10 @@ def talking_exposure():
|
|||
),
|
||||
infected=mc.InfectedPopulation(
|
||||
number=1,
|
||||
virus=virus_distributions['SARS_CoV_2'],
|
||||
virus=models.Virus(
|
||||
viral_load_in_sputum=symptomatic_vl_frequencies,
|
||||
infectious_dose=50.,
|
||||
),
|
||||
presence=mc.SpecificInterval(((0, 2),)),
|
||||
mask=models.Mask.types["No mask"],
|
||||
activity=activity_distributions['Seated'],
|
||||
|
|
@ -82,6 +88,36 @@ def talking_exposure():
|
|||
)
|
||||
return exposure_mc
|
||||
|
||||
######### Shouting model ###########
|
||||
def shouting_exposure():
|
||||
exposure_mc = mc.ExposureModel(
|
||||
concentration_model=mc.ConcentrationModel(
|
||||
room=models.Room(volume=100, humidity=0.5),
|
||||
ventilation=models.AirChange(
|
||||
active=models.SpecificInterval(((0, 24),)),
|
||||
air_exch=0.25,
|
||||
),
|
||||
infected=mc.InfectedPopulation(
|
||||
number=1,
|
||||
virus=models.Virus(
|
||||
viral_load_in_sputum=symptomatic_vl_frequencies,
|
||||
infectious_dose=50.,
|
||||
),
|
||||
presence=mc.SpecificInterval(((0, 2),)),
|
||||
mask=models.Mask.types["No mask"],
|
||||
activity=activity_distributions['Seated'],
|
||||
expiration=models.Expiration.types['Shouting'],
|
||||
),
|
||||
),
|
||||
exposed=mc.Population(
|
||||
number=14,
|
||||
presence=mc.SpecificInterval(((0, 2),)),
|
||||
activity=models.Activity.types['Seated'],
|
||||
mask=models.Mask.types["No mask"],
|
||||
),
|
||||
)
|
||||
return exposure_mc
|
||||
|
||||
######### Breathing model for specific viral load ###########
|
||||
def breathing_exposure_vl(vl):
|
||||
exposure_mc = mc.ExposureModel(
|
||||
|
|
|
|||
|
|
@ -33,11 +33,18 @@ emission_rate = exposure_model.concentration_model.infected.emission_rate_when_p
|
|||
print('\n<<<<<<<<<<< Breathing model statistics >>>>>>>>>>>')
|
||||
print_er_info(emission_rate)
|
||||
|
||||
############ Talking model ############
|
||||
exposure_mc = model_scenarios_paper.talking_exposure()
|
||||
############ Speaking model ############
|
||||
exposure_mc = model_scenarios_paper.speaking_exposure()
|
||||
exposure_model = exposure_mc.build_model(size=SAMPLE_SIZE)
|
||||
emission_rate = exposure_model.concentration_model.infected.emission_rate_when_present(cn_B=0.06, cn_L=0.2)
|
||||
print('\n<<<<<<<<<<< Talking model statistics >>>>>>>>>>>')
|
||||
print('\n<<<<<<<<<<< Speaking model statistics >>>>>>>>>>>')
|
||||
print_er_info(emission_rate)
|
||||
|
||||
############ Shouting model ############
|
||||
exposure_mc = model_scenarios_paper.shouting_exposure()
|
||||
exposure_model = exposure_mc.build_model(size=SAMPLE_SIZE)
|
||||
emission_rate = exposure_model.concentration_model.infected.emission_rate_when_present(cn_B=0.06, cn_L=0.2)
|
||||
print('\n<<<<<<<<<<< Shouting model statistics >>>>>>>>>>>')
|
||||
print_er_info(emission_rate)
|
||||
|
||||
############ Used for testing ############
|
||||
|
|
|
|||
|
|
@ -117,7 +117,6 @@ def exposure_model_from_vl_breathing_cn():
|
|||
emission_rate = exposure_model.concentration_model.infected.emission_rate_when_present(
|
||||
cn_B=0.06, cn_L=0.2) / 2
|
||||
er_means = np.append(er_means, np.mean(emission_rate))
|
||||
print_er_info(er_means)
|
||||
ax.plot(viral_loads, er_means, color=cmap.to_rgba(
|
||||
cn, alpha=0.75), linewidth=1, ls='--')
|
||||
plt.text(viral_loads[int(len(viral_loads)*0.9)], 10**4.2,
|
||||
|
|
@ -230,8 +229,6 @@ def exposure_model_from_vl_talking_cn():
|
|||
er_means = np.append(er_means, np.mean(emission_rate))
|
||||
ax.plot(viral_loads, er_means, color=cmap.to_rgba(
|
||||
cn, alpha=0.75), linewidth=1, ls='--')
|
||||
'''Statistical Data'''
|
||||
print_er_info(er_means)
|
||||
plt.text(viral_loads[int(len(viral_loads)*0.93)], 10**5.5,
|
||||
r"$\mathbf{c_{n,L}=0.2}$", color=cmap.to_rgba(cn), size='small')
|
||||
|
||||
|
|
@ -382,7 +379,7 @@ def print_er_info(er: np.array):
|
|||
"""
|
||||
print(f"MEAN of ER = {np.mean(er)}\n"
|
||||
f"SD of ER = {np.std(er)}\n"
|
||||
f"Median of qR = {np.quantile(er, 0.5)}\n")
|
||||
f"Median of ER = {np.quantile(er, 0.5)}\n")
|
||||
|
||||
print(f"Percentiles of ER:")
|
||||
for quantile in (0.01, 0.05, 0.25, 0.50, 0.55, 0.65, 0.75, 0.95, 0.99):
|
||||
|
|
|
|||
Loading…
Reference in a new issue