Commit 682e8602 authored by Peter Jentsch's avatar Peter Jentsch
Browse files

duration tests

parent 63697314
......@@ -131,12 +131,15 @@ end
for (expected_dist_mean,dist) in zip(dist_means,(ws_matrix_tuple...,rest_matrix_tuple...))
g = WeightedGraph(demographics,index_vectors,dist,contact_time_distributions.ws)
mixing_dist = [Variance() for _ in 1:3, _ in 1:3]
mixing_weights = [Variance() for _ in 1:3, _ in 1:3]
for v in vertices(g.g)
demo_v = demographics[v]
degs = zeros(3)
for w in LightGraphs.neighbors(g.g,v)
demo_w = demographics[w]
degs[Int(demo_w)] += 1
fit!(mixing_weights[Int(demo_v),Int(demo_w)],get_weight(g,GraphEdge(w,v)))
end
for (j,d) in enumerate(degs)
fit!(mixing_dist[Int(demo_v), j],d)
......@@ -148,6 +151,10 @@ end
@test mean(mixing_dist[i]) expected_dist_mean[i] atol = 0.05
@test mean(mixing_dist[i]) mean(dist[i]) atol = 0.2
end
for i in 1:3, j in 1:i
@test mean(mixing_weights[i,j]) contact_time_distributions.ws[i,j].μ atol = 0.25
end
end
end
......
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