Commit 133000c9 authored by Peter Jentsch's avatar Peter Jentsch
Browse files

fixed silly distribution adjust bug

parent 0bfd9b1d
......@@ -8,9 +8,9 @@ version = "1.0.1"
[[AbstractMCMC]]
deps = ["BangBang", "ConsoleProgressMonitor", "Distributed", "Logging", "LoggingExtras", "ProgressLogging", "Random", "StatsBase", "TerminalLoggers", "Transducers"]
git-tree-sha1 = "21279159f6be4b2fd00e1a4a1f736893100408fc"
git-tree-sha1 = "06e46b94299b6d0d9fb4f7833c7b1df3df6f9678"
uuid = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
version = "3.2.0"
version = "3.0.0"
[[AbstractTrees]]
git-tree-sha1 = "03e0550477d86222521d254b741d470ba17ea0b5"
......@@ -520,8 +520,8 @@ uuid = "5ab0869b-81aa-558d-bb23-cbf5423bbe9b"
version = "0.6.3"
[[KissABC]]
deps = ["AbstractMCMC", "Distributed", "Distributions", "MonteCarloMeasurements", "Random"]
path = "/home/peterj/Projects/PRs/KissABC.jl/"
deps = ["AbstractMCMC", "Distributions", "MonteCarloMeasurements", "Random"]
git-tree-sha1 = "693d4bd4cbb9ad6515414e0935bbd646b15fc16a"
uuid = "9c9dad79-530a-4643-a18b-2704674d4108"
version = "3.0.1"
......
using Distributed
addprocs(15)
@everywhere using CovidAlertVaccinationModel
using CovidAlertVaccinationModel
CovidAlertVaccinationModel.fit_parameters(CovidAlertVaccinationModel.get_parameters())
\ No newline at end of file
using CovidAlertVaccinationModel:ModelSolution, get_parameters, neighbors, GraphEdge, get_weight
using CovidAlertVaccinationModel:abm,ModelSolution, get_parameters, neighbors, GraphEdge, get_weight
function approximate_mixing_matricies()
sol = abm(get_parameters(),nothing)
p = get_parameters()
sol = abm(p,nothing)
mean_mixing = zeros(3,3)
display(mean_mixing)
display(sol.inf_network)
display(p.O_distribution_shift)
for (node_i,demo_i) in enumerate(sol.demographics)
for g_list in sol.inf_network.graph_list
for g in g_list
......@@ -19,6 +19,7 @@ function approximate_mixing_matricies()
display(mean_mixing)
return sol
end
approximate_mixing_matricies()
approximate_mixing_matricies();
println("dasdlkjasdas")
#rerun with weights
#
\ No newline at end of file
......@@ -8,7 +8,9 @@ function adjust_distributions_mean!(distribution_matrix,mean_shift_percentage)
for i in eachindex(distribution_matrix)
dist = distribution_matrix[i]
new_mean = mean(dist) + mean_shift_percentage
distribution_matrix[i] = from_mean(typeof(dist), new_mean)
end
end
......
......@@ -83,19 +83,23 @@ mutable struct ModelSolution{T,InfNet,SocNet,WSMixingDist,RestMixingDist}
demographics,base_network,index_vectors = generate_population(num_households)
nodes = length(demographics)
pop_sizes = length.(index_vectors)
ws_mixing_tuple_preshift = deepcopy(workschool_mixing)
rest_mixing_tuple_preshift = deepcopy(rest_mixing)
map(workschool_mixing) do md
for md in ws_mixing_tuple_preshift
adjust_distributions_mean!(md[1:3,3],params.O_distribution_shift)
adjust_distributions_mean!(md[3,1:3],params.O_distribution_shift)
adjust_distributions_mean!(md[3,1:2],params.O_distribution_shift)#dont shift OO twice
end
map(rest_mixing) do md
for md in rest_mixing_tuple_preshift
adjust_distributions_mean!( md[1:3,3],params.O_distribution_shift)
adjust_distributions_mean!( md[3,1:3],params.O_distribution_shift)
adjust_distributions_mean!( md[3,1:2],params.O_distribution_shift) #dont shift OO twice
end
map_symmetrize(m_tuple) = map(md -> symmetrize_means(pop_sizes,md), m_tuple)
ws_matrix_tuple = map_symmetrize(workschool_mixing)
rest_matrix_tuple = map_symmetrize(rest_mixing)
ws_matrix_tuple = map_symmetrize(ws_mixing_tuple_preshift)
rest_matrix_tuple = map_symmetrize(rest_mixing_tuple_preshift)
is_app_user = app_users(demographics,params.app_user_fraction)
app_user_list = zeros(nodes)
app_user_index = findall(==(true),is_app_user)
......
Markdown is supported
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