Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Peter Jentsch
CovidAlertABM
Commits
8d0333c7
Commit
8d0333c7
authored
Jun 25, 2021
by
Peter Jentsch
Browse files
new parameter planes, optionally record degrees
parent
6cfb5d27
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
18 deletions
+21
-18
CovidAlertVaccinationModel/abm_output/η_ω_en.dat
CovidAlertVaccinationModel/abm_output/η_ω_en.dat
+0
-0
CovidAlertVaccinationModel/plots/app_heatmaps/final_size_change.pdf
...VaccinationModel/plots/app_heatmaps/final_size_change.pdf
+0
-0
CovidAlertVaccinationModel/plots/app_heatmaps/wdg_change_M.pdf
...AlertVaccinationModel/plots/app_heatmaps/wdg_change_M.pdf
+0
-0
CovidAlertVaccinationModel/plots/app_heatmaps/wdg_change_O.pdf
...AlertVaccinationModel/plots/app_heatmaps/wdg_change_O.pdf
+0
-0
CovidAlertVaccinationModel/plots/app_heatmaps/wdg_change_Y.pdf
...AlertVaccinationModel/plots/app_heatmaps/wdg_change_Y.pdf
+0
-0
CovidAlertVaccinationModel/src/ABM/abm.jl
CovidAlertVaccinationModel/src/ABM/abm.jl
+2
-4
CovidAlertVaccinationModel/src/ABM/output.jl
CovidAlertVaccinationModel/src/ABM/output.jl
+2
-2
CovidAlertVaccinationModel/src/ABM/parameter_planes.jl
CovidAlertVaccinationModel/src/ABM/parameter_planes.jl
+17
-12
No files found.
CovidAlertVaccinationModel/abm_output/η_ω_en.dat
View file @
8d0333c7
No preview for this file type
CovidAlertVaccinationModel/plots/app_heatmaps/final_size_change.pdf
View file @
8d0333c7
No preview for this file type
CovidAlertVaccinationModel/plots/app_heatmaps/wdg_change_M.pdf
0 → 100644
View file @
8d0333c7
File added
CovidAlertVaccinationModel/plots/app_heatmaps/wdg_change_O.pdf
0 → 100644
View file @
8d0333c7
File added
CovidAlertVaccinationModel/plots/app_heatmaps/wdg_change_Y.pdf
0 → 100644
View file @
8d0333c7
File added
CovidAlertVaccinationModel/src/ABM/abm.jl
View file @
8d0333c7
const
population
=
14.57e6
#population of ontario
const
workschool_mixing
,
rest_mixing
=
load_mixing_matrices
()
const
age_bins
=
[(
0.0
,
25.0
),(
25.0
,
65.0
),(
65.0
,
Inf
)]
const
household_data
=
read_household_data
()
...
...
@@ -33,8 +31,8 @@ end
"""
Run the model with given parameter tuple and output recorder. See `get_parameters` for list of parameters. See `output.jl` for the list of recorders. Currently just 'DebugRecorder`.
"""
function
abm
(
parameters
)
model_sol
=
ModelSolution
(
parameters
.
sim_length
,
parameters
,
parameters
.
num_households
;
record_degrees
=
false
)
function
abm
(
parameters
;
record_degrees
=
false
)
model_sol
=
ModelSolution
(
parameters
.
sim_length
,
parameters
,
parameters
.
num_households
;
record_degrees
)
solve!
(
model_sol
)
return
model_sol
end
CovidAlertVaccinationModel/src/ABM/output.jl
View file @
8d0333c7
...
...
@@ -92,11 +92,11 @@ function record!(t,modelsol)
end
function
mean_solve
(
samples
,
parameter_tuple
;
progmeter
=
nothing
)
function
mean_solve
(
samples
,
parameter_tuple
;
progmeter
=
nothing
,
record_degrees
=
false
)
accumulation_recorder
=
Recorder
(
Variance
(),
parameter_tuple
.
sim_length
)
avg_populations
=
[
0.0
,
0.0
,
0.0
]
sol_list
=
map
(
1
:
samples
)
do
_
sol
=
abm
(
parameter_tuple
)
sol
=
abm
(
parameter_tuple
;
record_degrees
)
isnothing
(
progmeter
)
||
next!
(
progmeter
)
return
sol
.
output_data
,
length
.
(
sol
.
index_vectors
)
end
...
...
CovidAlertVaccinationModel/src/ABM/parameter_planes.jl
View file @
8d0333c7
const
samples
=
25
const
samples
=
40
const
univariate_path
=
"CovidAlertVaccinationModel/plots/univariate/"
const
bivariate_path
=
"CovidAlertVaccinationModel/plots/univariate/"
function
univarate_test
(
variable
,
variable_range
;
progmeter
=
nothing
)
...
...
@@ -58,7 +58,7 @@ end
using
AxisKeys
function
multivariate_simulations
()
len
=
20
len
=
15
app_simulations
=
(
(
:
η
,
range
(
0.0
,
2.0
;
length
=
len
)),
(
:
ω_en
,
range
(
0.0
,
1e-1
;
length
=
len
)),
...
...
@@ -79,13 +79,13 @@ function run_multivariate_sims(sims)
progmeter
=
Progress
((
length
(
simvars
)
+
1
)
*
samples
)
without_app
,
_
=
mean_solve
(
samples
,
get_parameters
();
progmeter
)
without_app
,
_
=
mean_solve
(
samples
,
get_parameters
();
progmeter
,
record_degrees
=
true
)
next!
(
progmeter
)
default_parameters
=
get_app_parameters
()
app_output
=
ThreadsX
.
map
(
simvars
)
do
vars
vars_with_names
=
NamedTuple
{
varnames
}(
vars
)
parameters
=
merge
(
default_parameters
,
vars_with_names
)
out
,
_
=
mean_solve
(
samples
,
parameters
;
progmeter
)
out
,
_
=
mean_solve
(
samples
,
parameters
;
progmeter
,
record_degrees
=
true
)
return
out
end
display
(
length
(
simvars
))
...
...
@@ -108,15 +108,20 @@ function plot_parameter_plane(input_fname)
mean_final_size
(
p
)
=
mean
(
reduce
(
merge!
,
p
.
final_size_by_age
))
base_outcome
=
mean_final_size
(
output_no_app
)
final_size_map
=
map
(
x
->
(
mean_final_size
(
x
)
-
base_outcome
),
output
)
mean_weighted_degree_change
(
p
)
=
mean
(
p
.
avg_weighted_degree_of_vaccinators
)
-
mean
(
p
.
avg_weighted_degree
)
weighted_degree_map
=
map
(
mean_weighted_degree_change
,
output
)
cs
=
cgrad
([
:
blue
,
:
orange
])
datamaps
=
[
weighted_degree_map
,
final_size_map
]
fnames
=
[
"wdg_change.pdf"
,
"final_size_change.pdf"
]
mean_weighted_degree_change
(
p
,
age
)
=
mean
(
p
.
avg_weighted_degree_of_vaccinators
[
age
])
-
mean
(
p
.
avg_weighted_degree
[
age
])
weighted_degree_map
=
[
map
(
p
->
mean_weighted_degree_change
(
p
,
i
),
output
)
for
i
in
1
:
3
]
cs
=
cgrad
(
:
blues
)
datamaps
=
(
weighted_degree_map
...
,
final_size_map
)
fnames
=
[
"wdg_change_Y.pdf"
,
"wdg_change_M.pdf"
,
"wdg_change_O.pdf"
,
"final_size_change.pdf"
]
titles
=
[
"Average w. deg. of vaccinators minus average w. deg."
,
"Average w. deg. of vaccinators minus average w. deg., Y"
,
"Average w. deg. of vaccinators minus average w. deg., M"
,
"Average w. deg. of vaccinators minus average w. deg., O"
,
"Effect of notifications on tot. infections"
,
]
for
(
fname
,
title
,
datamap
)
in
zip
(
fnames
,
titles
,
datamaps
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment