-
Notifications
You must be signed in to change notification settings - Fork 219
/
run_scenarios.py
59 lines (51 loc) · 1.54 KB
/
run_scenarios.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
'''
Simple script for running Covasim scenarios
'''
import covasim as cv
# Run options
do_plot = 1
do_show = 1
verbose = 1
# Sim options
basepars = dict(
pop_size = 2000,
verbose = verbose,
)
# Scenario metaparameters
metapars = dict(
n_runs = 3, # Number of parallel runs; change to 3 for quick, 11 for real
noise = 0.1, # Use noise, optionally
noisepar = 'beta',
rand_seed = 1,
quantiles = {'low':0.1, 'high':0.9},
)
# Define the actual scenarios
start_day = '2020-04-04'
scenarios = {'baseline': {
'name':'Baseline',
'pars': {
'interventions': None,
}
},
'distance': {
'name':'Social distancing',
'pars': {
'interventions': cv.change_beta(days=start_day, changes=0.7)
}
},
'ttq': {
'name':'Test-trace-quarantine',
'pars': {
'interventions': [
cv.test_prob(start_day=start_day, symp_prob=0.2, asymp_prob=0.05, test_delay=1.0),
cv.contact_tracing(start_day=start_day, trace_probs=0.8, trace_time=1.0),
]
}
},
}
# Run the scenarios -- this block is required for parallel processing on Windows
if __name__ == "__main__":
scens = cv.Scenarios(basepars=basepars, metapars=metapars, scenarios=scenarios)
scens.run(verbose=verbose)
if do_plot:
fig1 = scens.plot(do_show=do_show)