Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Peter Jentsch
CovidAlertABM
Commits
61d3c671
Commit
61d3c671
authored
Jul 06, 2021
by
Peter Jentsch
Browse files
record vac degrees
parent
26e07794
Changes
7
Hide whitespace changes
Inline
Side-by-side
.vscode/settings.json
View file @
61d3c671
{
"julia.environmentPath"
:
"/home/peterj/.julia/environments/v1.6"
}
\ No newline at end of file
CovidAlertVaccinationModel/abm_timeseries.jl
View file @
61d3c671
...
...
@@ -3,10 +3,10 @@ using OnlineStats
using
Plots
pgfplotsx
()
using
CovidAlertVaccinationModel
:
vaccination_data
,
ymo_vac
,
ymo_attack_rate
const
samples
=
10
const
samples
=
25
function
solve_and_plot_parameters
()
p
=
CovidAlertVaccinationModel
.
get_
app_
parameters
()
p
=
CovidAlertVaccinationModel
.
get_parameters
()
display
(
p
)
out
,
avg_populations
=
mean_solve
(
samples
,
p
,
record_degrees
=
true
)
p
=
plot_model
(
nothing
,[
nothing
],[
out
],
p
)
...
...
CovidAlertVaccinationModel/src/ABM/output.jl
View file @
61d3c671
...
...
@@ -22,6 +22,7 @@ struct Recorder{ElType,ArrT1,ArrT2,ArrT3,StatAccumulator}
record_degrees_flag
::
Bool
avg_weighted_degree_of_vaccinators
::
Vector
{
StatAccumulator
}
avg_weighted_degree
::
Vector
{
StatAccumulator
}
avg_weighted_degree_of_vaccinator_belief
::
Vector
{
StatAccumulator
}
function
Recorder
(
val
::
T
,
sim_length
;
record_degrees
=
false
)
where
T
...
...
@@ -45,6 +46,8 @@ struct Recorder{ElType,ArrT1,ArrT2,ArrT3,StatAccumulator}
avg_weighted_degree_of_vaccinators
=
[
Variance
()
for
_
in
1
:
3
]
avg_weighted_degree
=
[
Variance
()
for
_
in
1
:
3
]
avg_weighted_degree_of_vaccinator_belief
=
[
Variance
()
for
_
in
1
:
sim_length
]
return
new
{
T
,
typeof
(
state_totals
),
typeof
(
total_vaccinators
),
typeof
(
daily_immunized_by_age
),
eltype
(
avg_weighted_degree
)}(
state_totals
,
...
...
@@ -61,7 +64,8 @@ struct Recorder{ElType,ArrT1,ArrT2,ArrT3,StatAccumulator}
daily_unvac_by_age
,
record_degrees
,
avg_weighted_degree_of_vaccinators
,
avg_weighted_degree
avg_weighted_degree
,
avg_weighted_degree_of_vaccinator_belief
)
end
end
...
...
CovidAlertVaccinationModel/src/ABM/plotting.jl
View file @
61d3c671
...
...
@@ -24,6 +24,7 @@ function plot_model(varname,univariate_series, output_list::Vector{T},p) where T
(
x_axis
,
data
.
daily_immunized_by_age
.
O
,
"new O vaccinations each day"
),
(
x_axis
,
data
.
daily_total_notifications
,
"total notifications each day"
),
(
x_axis
,
data
.
daily_total_notified_agents
,
"total notified agents each day"
),
(
x_axis
,
data
.
avg_weighted_degree_of_vaccinator_belief
,
"Average weighted degree of vaccinators"
),
zoom
((
x_axis
,
data
.
daily_cases_by_age
.
Y
,
"Daily Y cases (zoomed in)"
)),
zoom
((
x_axis
,
data
.
daily_cases_by_age
.
M
,
"Daily M cases (zoomed in)"
)),
zoom
((
x_axis
,
data
.
daily_cases_by_age
.
O
,
"Daily O cases (zoomed in)"
)),
...
...
CovidAlertVaccinationModel/src/ABM/solve.jl
View file @
61d3c671
...
...
@@ -184,6 +184,10 @@ function agents_step!(t,modelsol,vaccinate_today)
elseif
immunization_countdown
[
agent
]
>
0
immunization_countdown
[
agent
]
-=
1
end
if
u_vac
[
agent
]
fit!
(
output_data
.
avg_weighted_degree_of_vaccinator_belief
[
t
],
weighted_degree_of_i
)
end
update_vaccination_opinion_state!
(
t
,
agent
,
agent_demo
,
modelsol
,
vaccinate_today
,
total_infected
,
π_base_vec
,
weighted_degree_of_i
)
end
...
...
CovidAlertVaccinationModel/test/ABM/output_test.jl
View file @
61d3c671
using
CovidAlertVaccinationModel
:
vaccination_data
,
ymo_vac
,
ymo_attack_rate
using
OnlineStats
using
Plots
const
samples
=
1
0
const
samples
=
5
0
using
Random
@testset
"default parameters output"
begin
...
...
timeseries.pdf
View file @
61d3c671
No preview for this file type
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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