Commit 61d3c671 authored by Peter Jentsch's avatar Peter Jentsch
Browse files

record vac degrees

parent 26e07794
{
"julia.environmentPath": "/home/peterj/.julia/environments/v1.6"
}
\ No newline at end of file
......@@ -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)
......
......@@ -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
......
......@@ -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)")),
......
......@@ -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
......
using CovidAlertVaccinationModel:vaccination_data,ymo_vac,ymo_attack_rate
using OnlineStats
using Plots
const samples = 10
const samples = 50
using Random
@testset "default parameters output" begin
......
No preview for this file type
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment