diff --git a/results/MAT_files/support_bubble_visit_plan_alternative_analysis.mat b/results/MAT_files/support_bubble_visit_plan_alternative_analysis.mat index 35ad6f1..e85da27 100644 Binary files a/results/MAT_files/support_bubble_visit_plan_alternative_analysis.mat and b/results/MAT_files/support_bubble_visit_plan_alternative_analysis.mat differ diff --git a/results/MAT_files/support_bubble_visit_plan_alternative_analysis_lower_adherence.mat b/results/MAT_files/support_bubble_visit_plan_alternative_analysis_lower_adherence.mat index 8cfa661..7b92bfb 100644 Binary files a/results/MAT_files/support_bubble_visit_plan_alternative_analysis_lower_adherence.mat and b/results/MAT_files/support_bubble_visit_plan_alternative_analysis_lower_adherence.mat differ diff --git a/results/MAT_files/support_bubble_visit_plan_main_analysis.mat b/results/MAT_files/support_bubble_visit_plan_main_analysis.mat index 5f8737f..104ff05 100644 Binary files a/results/MAT_files/support_bubble_visit_plan_main_analysis.mat and b/results/MAT_files/support_bubble_visit_plan_main_analysis.mat differ diff --git a/results/MAT_files/support_bubble_visit_plan_main_analysis_lower_adherence.mat b/results/MAT_files/support_bubble_visit_plan_main_analysis_lower_adherence.mat index 54659ba..3b871f0 100644 Binary files a/results/MAT_files/support_bubble_visit_plan_main_analysis_lower_adherence.mat and b/results/MAT_files/support_bubble_visit_plan_main_analysis_lower_adherence.mat differ diff --git a/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_alternative_analysis.mat b/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_alternative_analysis.mat index 28b8925..7c16760 100644 Binary files a/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_alternative_analysis.mat and b/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_alternative_analysis.mat differ diff --git a/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_alternative_analysis_lower_adherence.mat b/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_alternative_analysis_lower_adherence.mat index 74f0aef..d02ffe0 100644 Binary files a/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_alternative_analysis_lower_adherence.mat and b/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_alternative_analysis_lower_adherence.mat differ diff --git a/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_main_analysis.mat b/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_main_analysis.mat index 76e24de..f048cab 100644 Binary files a/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_main_analysis.mat and b/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_main_analysis.mat differ diff --git a/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_main_analysis_lower_adherence.mat b/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_main_analysis_lower_adherence.mat index 7f23db9..24c81c6 100644 Binary files a/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_main_analysis_lower_adherence.mat and b/results/MAT_files/three_household_faithful_bubble_shorter_visit_plan_main_analysis_lower_adherence.mat differ diff --git a/results/MAT_files/three_household_faithful_bubble_visit_plan_alternative_analysis.mat b/results/MAT_files/three_household_faithful_bubble_visit_plan_alternative_analysis.mat index 707a059..89cda99 100644 Binary files a/results/MAT_files/three_household_faithful_bubble_visit_plan_alternative_analysis.mat and b/results/MAT_files/three_household_faithful_bubble_visit_plan_alternative_analysis.mat differ diff --git a/results/MAT_files/three_household_faithful_bubble_visit_plan_alternative_analysis_lower_adherence.mat b/results/MAT_files/three_household_faithful_bubble_visit_plan_alternative_analysis_lower_adherence.mat index bb72086..1e0e1b3 100644 Binary files a/results/MAT_files/three_household_faithful_bubble_visit_plan_alternative_analysis_lower_adherence.mat and b/results/MAT_files/three_household_faithful_bubble_visit_plan_alternative_analysis_lower_adherence.mat differ diff --git a/results/MAT_files/three_household_faithful_bubble_visit_plan_main_analysis.mat b/results/MAT_files/three_household_faithful_bubble_visit_plan_main_analysis.mat index 5753ac6..ac664ec 100644 Binary files a/results/MAT_files/three_household_faithful_bubble_visit_plan_main_analysis.mat and b/results/MAT_files/three_household_faithful_bubble_visit_plan_main_analysis.mat differ diff --git a/results/MAT_files/three_household_faithful_bubble_visit_plan_main_analysis_lower_adherence.mat b/results/MAT_files/three_household_faithful_bubble_visit_plan_main_analysis_lower_adherence.mat index b668b87..0658191 100644 Binary files a/results/MAT_files/three_household_faithful_bubble_visit_plan_main_analysis_lower_adherence.mat and b/results/MAT_files/three_household_faithful_bubble_visit_plan_main_analysis_lower_adherence.mat differ diff --git a/results/MAT_files/three_household_fixed_bubble_visit_plan_alternative_analysis.mat b/results/MAT_files/three_household_fixed_bubble_visit_plan_alternative_analysis.mat index 746bde1..e0f64d5 100644 Binary files a/results/MAT_files/three_household_fixed_bubble_visit_plan_alternative_analysis.mat and b/results/MAT_files/three_household_fixed_bubble_visit_plan_alternative_analysis.mat differ diff --git a/results/MAT_files/three_household_fixed_bubble_visit_plan_alternative_analysis_lower_adherence.mat b/results/MAT_files/three_household_fixed_bubble_visit_plan_alternative_analysis_lower_adherence.mat index b52f4bc..78b150e 100644 Binary files a/results/MAT_files/three_household_fixed_bubble_visit_plan_alternative_analysis_lower_adherence.mat and b/results/MAT_files/three_household_fixed_bubble_visit_plan_alternative_analysis_lower_adherence.mat differ diff --git a/results/MAT_files/three_household_fixed_bubble_visit_plan_main_analysis.mat b/results/MAT_files/three_household_fixed_bubble_visit_plan_main_analysis.mat index 7b38ebe..e77e0a2 100644 Binary files a/results/MAT_files/three_household_fixed_bubble_visit_plan_main_analysis.mat and b/results/MAT_files/three_household_fixed_bubble_visit_plan_main_analysis.mat differ diff --git a/results/MAT_files/three_household_fixed_bubble_visit_plan_main_analysis_lower_adherence.mat b/results/MAT_files/three_household_fixed_bubble_visit_plan_main_analysis_lower_adherence.mat index 69d71a3..6b225d9 100644 Binary files a/results/MAT_files/three_household_fixed_bubble_visit_plan_main_analysis_lower_adherence.mat and b/results/MAT_files/three_household_fixed_bubble_visit_plan_main_analysis_lower_adherence.mat differ diff --git a/results/MAT_files/three_household_unfaithful_bubble_visit_plan_alternative_analysis.mat b/results/MAT_files/three_household_unfaithful_bubble_visit_plan_alternative_analysis.mat index b30f7f9..e3e459d 100644 Binary files a/results/MAT_files/three_household_unfaithful_bubble_visit_plan_alternative_analysis.mat and b/results/MAT_files/three_household_unfaithful_bubble_visit_plan_alternative_analysis.mat differ diff --git a/results/MAT_files/three_household_unfaithful_bubble_visit_plan_alternative_analysis_lower_adherence.mat b/results/MAT_files/three_household_unfaithful_bubble_visit_plan_alternative_analysis_lower_adherence.mat index 4bbb9a1..52fa9ad 100644 Binary files a/results/MAT_files/three_household_unfaithful_bubble_visit_plan_alternative_analysis_lower_adherence.mat and b/results/MAT_files/three_household_unfaithful_bubble_visit_plan_alternative_analysis_lower_adherence.mat differ diff --git a/results/MAT_files/three_household_unfaithful_bubble_visit_plan_main_analysis.mat b/results/MAT_files/three_household_unfaithful_bubble_visit_plan_main_analysis.mat index 55db3db..4ec149a 100644 Binary files a/results/MAT_files/three_household_unfaithful_bubble_visit_plan_main_analysis.mat and b/results/MAT_files/three_household_unfaithful_bubble_visit_plan_main_analysis.mat differ diff --git a/results/MAT_files/three_household_unfaithful_bubble_visit_plan_main_analysis_lower_adherence.mat b/results/MAT_files/three_household_unfaithful_bubble_visit_plan_main_analysis_lower_adherence.mat index d219dd5..3a17335 100644 Binary files a/results/MAT_files/three_household_unfaithful_bubble_visit_plan_main_analysis_lower_adherence.mat and b/results/MAT_files/three_household_unfaithful_bubble_visit_plan_main_analysis_lower_adherence.mat differ diff --git a/results/figure_files/alternative_analysis/new_infections_age_breakdown_violins_percentages_alternative_analysis_23Dec2020_27Dec2020.pdf b/results/figure_files/alternative_analysis/new_infections_age_breakdown_violins_percentages_alternative_analysis_23Dec2020_27Dec2020.pdf index de8e865..44c0203 100644 Binary files a/results/figure_files/alternative_analysis/new_infections_age_breakdown_violins_percentages_alternative_analysis_23Dec2020_27Dec2020.pdf and b/results/figure_files/alternative_analysis/new_infections_age_breakdown_violins_percentages_alternative_analysis_23Dec2020_27Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis/new_infections_age_breakdown_violins_percentages_alternative_analysis_whole_time_horizon.pdf b/results/figure_files/alternative_analysis/new_infections_age_breakdown_violins_percentages_alternative_analysis_whole_time_horizon.pdf index 77e01a7..70b1a75 100644 Binary files a/results/figure_files/alternative_analysis/new_infections_age_breakdown_violins_percentages_alternative_analysis_whole_time_horizon.pdf and b/results/figure_files/alternative_analysis/new_infections_age_breakdown_violins_percentages_alternative_analysis_whole_time_horizon.pdf differ diff --git a/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_23Dec2020.pdf b/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_23Dec2020.pdf index 4d32261..e70ad3c 100644 Binary files a/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_23Dec2020.pdf and b/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_23Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_24Dec2020.pdf b/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_24Dec2020.pdf index 9583af3..43b5659 100644 Binary files a/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_24Dec2020.pdf and b/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_24Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_25Dec2020.pdf b/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_25Dec2020.pdf index ab02fe9..c630476 100644 Binary files a/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_25Dec2020.pdf and b/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_25Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_26Dec2020.pdf b/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_26Dec2020.pdf index dd566c3..ff7e831 100644 Binary files a/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_26Dec2020.pdf and b/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_26Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_27Dec2020.pdf b/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_27Dec2020.pdf index 355eb20..c939523 100644 Binary files a/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_27Dec2020.pdf and b/results/figure_files/alternative_analysis/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_27Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis/newinf_percentage_age_grps_violins_alternative_analysis_whole_time_horizon.pdf b/results/figure_files/alternative_analysis/newinf_percentage_age_grps_violins_alternative_analysis_whole_time_horizon.pdf index 51ac464..c8478f2 100644 Binary files a/results/figure_files/alternative_analysis/newinf_percentage_age_grps_violins_alternative_analysis_whole_time_horizon.pdf and b/results/figure_files/alternative_analysis/newinf_percentage_age_grps_violins_alternative_analysis_whole_time_horizon.pdf differ diff --git a/results/figure_files/alternative_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_alternative_analysis_lower_adherence_23Dec2020_27Dec2020.pdf b/results/figure_files/alternative_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_alternative_analysis_lower_adherence_23Dec2020_27Dec2020.pdf index 45c0f38..8441b4c 100644 Binary files a/results/figure_files/alternative_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_alternative_analysis_lower_adherence_23Dec2020_27Dec2020.pdf and b/results/figure_files/alternative_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_alternative_analysis_lower_adherence_23Dec2020_27Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_alternative_analysis_lower_adherence_whole_time_horizon.pdf b/results/figure_files/alternative_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_alternative_analysis_lower_adherence_whole_time_horizon.pdf index 7af4859..b230c11 100644 Binary files a/results/figure_files/alternative_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_alternative_analysis_lower_adherence_whole_time_horizon.pdf and b/results/figure_files/alternative_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_alternative_analysis_lower_adherence_whole_time_horizon.pdf differ diff --git a/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_23Dec2020.pdf b/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_23Dec2020.pdf index 452b2f7..d37b990 100644 Binary files a/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_23Dec2020.pdf and b/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_23Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_24Dec2020.pdf b/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_24Dec2020.pdf index 4ad8cdb..3768451 100644 Binary files a/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_24Dec2020.pdf and b/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_24Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_25Dec2020.pdf b/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_25Dec2020.pdf index 1362469..45569c8 100644 Binary files a/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_25Dec2020.pdf and b/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_25Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_26Dec2020.pdf b/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_26Dec2020.pdf index 9122101..dce1b9f 100644 Binary files a/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_26Dec2020.pdf and b/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_26Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_27Dec2020.pdf b/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_27Dec2020.pdf index 3711071..808ffd0 100644 Binary files a/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_27Dec2020.pdf and b/results/figure_files/alternative_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_alternative_analysis_lower_adherence_27Dec2020.pdf differ diff --git a/results/figure_files/alternative_analysis_lower_adherence/newinf_percentage_age_grps_violins_alternative_analysis_lower_adherence_whole_time_horizon.pdf b/results/figure_files/alternative_analysis_lower_adherence/newinf_percentage_age_grps_violins_alternative_analysis_lower_adherence_whole_time_horizon.pdf index fbcf0bd..a36ae7b 100644 Binary files a/results/figure_files/alternative_analysis_lower_adherence/newinf_percentage_age_grps_violins_alternative_analysis_lower_adherence_whole_time_horizon.pdf and b/results/figure_files/alternative_analysis_lower_adherence/newinf_percentage_age_grps_violins_alternative_analysis_lower_adherence_whole_time_horizon.pdf differ diff --git a/results/figure_files/main_analysis/new_infections_age_breakdown_violins_percentages_main_analysis_23Dec2020_27Dec2020.pdf b/results/figure_files/main_analysis/new_infections_age_breakdown_violins_percentages_main_analysis_23Dec2020_27Dec2020.pdf index a5485af..e0a26ab 100644 Binary files a/results/figure_files/main_analysis/new_infections_age_breakdown_violins_percentages_main_analysis_23Dec2020_27Dec2020.pdf and b/results/figure_files/main_analysis/new_infections_age_breakdown_violins_percentages_main_analysis_23Dec2020_27Dec2020.pdf differ diff --git a/results/figure_files/main_analysis/new_infections_age_breakdown_violins_percentages_main_analysis_whole_time_horizon.pdf b/results/figure_files/main_analysis/new_infections_age_breakdown_violins_percentages_main_analysis_whole_time_horizon.pdf index f2de05a..3352461 100644 Binary files a/results/figure_files/main_analysis/new_infections_age_breakdown_violins_percentages_main_analysis_whole_time_horizon.pdf and b/results/figure_files/main_analysis/new_infections_age_breakdown_violins_percentages_main_analysis_whole_time_horizon.pdf differ diff --git a/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_23Dec2020.pdf b/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_23Dec2020.pdf index 1e04616..44002d9 100644 Binary files a/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_23Dec2020.pdf and b/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_23Dec2020.pdf differ diff --git a/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_24Dec2020.pdf b/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_24Dec2020.pdf index ed9772b..5279654 100644 Binary files a/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_24Dec2020.pdf and b/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_24Dec2020.pdf differ diff --git a/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_25Dec2020.pdf b/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_25Dec2020.pdf index 12a8428..328f007 100644 Binary files a/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_25Dec2020.pdf and b/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_25Dec2020.pdf differ diff --git a/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_26Dec2020.pdf b/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_26Dec2020.pdf index 933d195..acc9827 100644 Binary files a/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_26Dec2020.pdf and b/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_26Dec2020.pdf differ diff --git a/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_27Dec2020.pdf b/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_27Dec2020.pdf index 557363f..0aa5f66 100644 Binary files a/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_27Dec2020.pdf and b/results/figure_files/main_analysis/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_27Dec2020.pdf differ diff --git a/results/figure_files/main_analysis/newinf_percentage_age_grps_violins_main_analysis_whole_time_horizon.pdf b/results/figure_files/main_analysis/newinf_percentage_age_grps_violins_main_analysis_whole_time_horizon.pdf index ec48592..a32e0de 100644 Binary files a/results/figure_files/main_analysis/newinf_percentage_age_grps_violins_main_analysis_whole_time_horizon.pdf and b/results/figure_files/main_analysis/newinf_percentage_age_grps_violins_main_analysis_whole_time_horizon.pdf differ diff --git a/results/figure_files/main_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_main_analysis_lower_adherence_23Dec2020_27Dec2020.pdf b/results/figure_files/main_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_main_analysis_lower_adherence_23Dec2020_27Dec2020.pdf index 59d28b8..1fd4035 100644 Binary files a/results/figure_files/main_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_main_analysis_lower_adherence_23Dec2020_27Dec2020.pdf and b/results/figure_files/main_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_main_analysis_lower_adherence_23Dec2020_27Dec2020.pdf differ diff --git a/results/figure_files/main_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_main_analysis_lower_adherence_whole_time_horizon.pdf b/results/figure_files/main_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_main_analysis_lower_adherence_whole_time_horizon.pdf index 1bb3db5..f8a745e 100644 Binary files a/results/figure_files/main_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_main_analysis_lower_adherence_whole_time_horizon.pdf and b/results/figure_files/main_analysis_lower_adherence/new_infections_age_breakdown_violins_percentages_main_analysis_lower_adherence_whole_time_horizon.pdf differ diff --git a/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_23Dec2020.pdf b/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_23Dec2020.pdf index 7020b31..b3ea40a 100644 Binary files a/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_23Dec2020.pdf and b/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_23Dec2020.pdf differ diff --git a/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_24Dec2020.pdf b/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_24Dec2020.pdf index e85323e..84e9a01 100644 Binary files a/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_24Dec2020.pdf and b/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_24Dec2020.pdf differ diff --git a/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_25Dec2020.pdf b/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_25Dec2020.pdf index ec57afc..21e749d 100644 Binary files a/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_25Dec2020.pdf and b/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_25Dec2020.pdf differ diff --git a/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_26Dec2020.pdf b/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_26Dec2020.pdf index e8b60fd..d351b28 100644 Binary files a/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_26Dec2020.pdf and b/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_26Dec2020.pdf differ diff --git a/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_27Dec2020.pdf b/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_27Dec2020.pdf index 153ea64..0499221 100644 Binary files a/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_27Dec2020.pdf and b/results/figure_files/main_analysis_lower_adherence/new_latent_age_propn_of_age_grps_violins_percentages_main_analysis_lower_adherence_27Dec2020.pdf differ diff --git a/results/figure_files/main_analysis_lower_adherence/newinf_percentage_age_grps_violins_main_analysis_lower_adherence_whole_time_horizon.pdf b/results/figure_files/main_analysis_lower_adherence/newinf_percentage_age_grps_violins_main_analysis_lower_adherence_whole_time_horizon.pdf index d29e669..c707ae3 100644 Binary files a/results/figure_files/main_analysis_lower_adherence/newinf_percentage_age_grps_violins_main_analysis_lower_adherence_whole_time_horizon.pdf and b/results/figure_files/main_analysis_lower_adherence/newinf_percentage_age_grps_violins_main_analysis_lower_adherence_whole_time_horizon.pdf differ diff --git a/src/include_files_stochastic_householdIBM/populate_hh_visit_plan_fns.jl b/src/include_files_stochastic_householdIBM/populate_hh_visit_plan_fns.jl index 1f358e8..306e7cf 100644 --- a/src/include_files_stochastic_householdIBM/populate_hh_visit_plan_fns.jl +++ b/src/include_files_stochastic_householdIBM/populate_hh_visit_plan_fns.jl @@ -21,24 +21,38 @@ Gives household IDs contacted in each visit. Stratified per person and per times #============================= Supporting functions =============================# -function get_hh_support_bubble_status_vecs(info_per_household::Array{household_info,1}) +function update_visitation_schedule!(christmas_bubble_hh_IDs::Array{Int64,1}, + hh_mixed_with_by_day::Array{Array{Int64,1},1}) - # Get households IDs - hh_IDs = getproperty.(info_per_household, :household_ID) + # Iterate over pairs of households within the household triplet. + # Record on visitation schedule for period of time where social restrictions + # are eased + for index_itr = 1:length(christmas_bubble_hh_IDs) + index_hh_ID = christmas_bubble_hh_IDs[index_itr] + for contact_itr = 1:length(christmas_bubble_hh_IDs) + if index_itr != contact_itr + contact_hh_ID = christmas_bubble_hh_IDs[contact_itr] + append!(hh_mixed_with_by_day[index_hh_ID],contact_hh_ID) + end + end - # Get support bubble status for each household - hh_support_bubble_status = getproperty.(info_per_household, :in_support_bubble) + # Remove any duplicate entries + sort!(hh_mixed_with_by_day[index_hh_ID]) + unique!(hh_mixed_with_by_day[index_hh_ID]) - # Produce lists - hh_in_support_bubble = hh_IDs[hh_support_bubble_status.== true] - hh_not_in_support_bubble = hh_IDs[hh_support_bubble_status.== false] + # Error check. If three extended households form a Christmas bubble, + # that would give a maximum of six individual households. + # Therefore, cannot visit more than five other households + if length(hh_mixed_with_by_day[index_hh_ID]) > 5 + error("More than five households visited by hh $index_hh_ID: $(hh_mixed_with_by_day[index_hh_ID])") + end + end - return hh_in_support_bubble::Array{Int64,1}, - hh_not_in_support_bubble::Array{Int64,1} + return nothing end -function update_visitation_schedule!(christmas_bubble_hh_IDs::Array{Int64,1}, - hh_mixed_with_by_day::Array{Array{Int64,1},1}) +function update_visitation_schedule_scenario_D!(christmas_bubble_hh_IDs::Array{Int64,1}, + hh_mixed_with_by_day::Array{Array{Int64,1},1}) # Iterate over pairs of households within the household triplet. # Record on visitation schedule for period of time where social restrictions @@ -52,9 +66,15 @@ function update_visitation_schedule!(christmas_bubble_hh_IDs::Array{Int64,1}, end end - # Error check. Should not be more than two other households met. - if length(hh_mixed_with_by_day[index_hh_ID]) > 2 - error("More than two households visited by hh $index_hh_ID: $(hh_mixed_with_by_day[index_hh_ID])") + # Remove any duplicate entries + sort!(hh_mixed_with_by_day[index_hh_ID]) + unique!(hh_mixed_with_by_day[index_hh_ID]) + + # Error check. If three extended households form a Christmas bubble, + # that would give a maximum of six individual households. + # Therefore, cannot visit more than five other households + if length(hh_mixed_with_by_day[index_hh_ID]) > 5 + error("More than five households visited by hh $index_hh_ID: $(hh_mixed_with_by_day[index_hh_ID])") end end @@ -106,6 +126,74 @@ function update_hh_visit_plan!(hh_visit_plan::Array{Array{Array{Int64,1},1},2}, return nothing end +function construct_christmas_bubbles_and_update_visit_schedule!(rng::MersenneTwister, + n_households::Int64, + info_per_household::Array{household_info,1}, + hh_mixed_with_by_day::Array{Array{Int64,1},1}) + + # Get a list of households, with just one of pair of households included if in support bubble + # Iterate over each household. + # Update flag variable: Initially true. Set to false if the support bubble household of another household + hh_to_include_in_bubble_assignment_flag_vec = ones(Bool,n_households) + for hh_ID = 1:n_households + if hh_to_include_in_bubble_assignment_flag_vec[hh_ID] == true + + # Check if in a support bubble + # If true, for other household in support bubble set + # hh_to_include_in_bubble_assignment_flag_vec to false + if info_per_household[hh_ID].in_support_bubble == true + support_bubble_hh_ID = info_per_household[hh_ID].support_bubble_household_ID + hh_to_include_in_bubble_assignment_flag_vec[support_bubble_hh_ID] = false + end + end + end + + # Construct lookup vector of houehold IDs to use for constructing household + # triplets + hh_ID_vec = collect(1:1:n_households) + hh_bubble_assignment_IDs = hh_ID_vec[hh_to_include_in_bubble_assignment_flag_vec .== true] + + # Shuffle order of hh_bubble_assignment_IDs + shuffle!(rng,hh_bubble_assignment_IDs) + + # Contact assignment for household triplets + n_hh_bubble_triplets = ceil(Int64,length(hh_bubble_assignment_IDs)/3) + for hh_bubble_itr = 1:n_hh_bubble_triplets + start_access_idx = ((hh_bubble_itr-1)*3) + 1 + end_access_idx = (hh_bubble_itr*3) + + # Have check if end index exceeds length of hh_bubble_assignment_IDs + if end_access_idx > length(hh_bubble_assignment_IDs) + end_access_idx = length(hh_bubble_assignment_IDs) + end + + # Construct list of households in Christmas bubble + christmas_bubble_hh_IDs = Int64[] + for hh_bubble_assignment_ID_itr = start_access_idx:1:end_access_idx + current_itr_hh_ID = hh_bubble_assignment_IDs[hh_bubble_assignment_ID_itr] + append!(christmas_bubble_hh_IDs,current_itr_hh_ID) + + # Check if household is in a support bubble + # If true, add support bubble household to christmas_bubble_hh_IDs + if info_per_household[current_itr_hh_ID].in_support_bubble == true + support_bubble_hh_ID = info_per_household[current_itr_hh_ID].support_bubble_household_ID + + # Error check + if info_per_household[support_bubble_hh_ID].household_ID != support_bubble_hh_ID + error("support_bubble_hh_ID, $support_bubble_hh_ID, and info_per_household[support_bubble_hh_ID].household_ID $(info_per_household[support_bubble_hh_ID].household_ID) do not match.") + end + + # Add support bubble household ID to list of households in Christmas bubble + append!(christmas_bubble_hh_IDs,support_bubble_hh_ID) + end + end + + # Update hh_mixed_with_by_day + update_visitation_schedule!(christmas_bubble_hh_IDs, + hh_mixed_with_by_day) + end + +end #============================= Main bubble formation functions @@ -161,66 +249,11 @@ function three_household_faithful_bubble_shorter_visit_plan!(hh_visit_plan::Arra hh_mixed_with_by_day[hh_itr] = [] end - # Support bubble paris need a non-support bubble household. - # Get lists of households in support bubble and not in support bubble - hh_in_support_bubble, - hh_not_in_support_bubble = get_hh_support_bubble_status_vecs(info_per_household) - - # Shuffle order of hh_not_in_support_bubble - shuffle!(rng,hh_not_in_support_bubble) - - # Initialise index counter for assigning non-support bubble households to a triplet - # with two households that are in a support bubble - hh_not_in_support_bubble_idx = 1 - - # Support bubble pairs can only form christmas bubble with a non-support bubble household. - support_bubble_allocated_to_christmas_bubble = zeros(Bool,length(hh_in_support_bubble)) - for support_bubble_hh_itr = 1:length(hh_in_support_bubble) - # Get household ID of index househould in this loop iteration - support_bubble_hh_ID = hh_in_support_bubble[support_bubble_hh_itr] - - # Error check - if info_per_household[support_bubble_hh_ID].household_ID != support_bubble_hh_ID - error("support_bubble_hh_ID, $support_bubble_hh_ID, and info_per_household[support_bubble_hh_ID].household_ID $(info_per_household[support_bubble_hh_ID].household_ID) do not match.") - end - - # Check if already assigned to christmas bubble - if support_bubble_allocated_to_christmas_bubble[support_bubble_hh_itr] == false - - # If yet to be assigned, take next household in list of hh_not_in_support_bubble - third_hh_in_bubble_ID = hh_not_in_support_bubble[hh_not_in_support_bubble_idx] - hh_not_in_support_bubble_idx += 1 # Increment index access counter - - # Update assignment status of other household in support bubble - other_hh_in_support_bubble_ID = info_per_household[support_bubble_hh_ID].support_bubble_household_ID # Get ID of other household in support bubble - support_bubble_allocated_to_christmas_bubble[hh_in_support_bubble .== other_hh_in_support_bubble_ID] .= true - # Find relevant index in list of household IDs in support bubbles that matches - # the ID of household in this support bubble - - # Update assignment status of index household - support_bubble_allocated_to_christmas_bubble[support_bubble_hh_itr] = true - - # Do contact assignment for household triplet - # Update hh_mixed_with_by_day - christmas_bubble_hh_IDs = [support_bubble_hh_ID; - other_hh_in_support_bubble_ID; - third_hh_in_bubble_ID] - update_visitation_schedule!(christmas_bubble_hh_IDs, - hh_mixed_with_by_day) - - end - end - - # Once all support bubbles allocated a triple, remaining households can be allocated as triples. - remaining_hh_to_assign_to_bubble = length(hh_not_in_support_bubble) - (hh_not_in_support_bubble_idx - 1) - n_triples = ceil(Int64,remaining_hh_to_assign_to_bubble/3) - for hh_grp_itr = 1:n_triples - start_idx = hh_not_in_support_bubble_idx + ((hh_grp_itr-1)*3) # Don't need to +1 as hh_not_in_support_bubble_idx one larger than actual number of non-support bubble hh allocated to christmas bubbles - end_idx = min((hh_not_in_support_bubble_idx - 1) + (hh_grp_itr*3),length(hh_not_in_support_bubble)) - household_ID_slice = hh_not_in_support_bubble[start_idx:end_idx] - update_visitation_schedule!(household_ID_slice, - hh_mixed_with_by_day) - end + # Construct Christmas bubbles and update visit schedule + construct_christmas_bubbles_and_update_visit_schedule!(rng, + n_households, + info_per_household, + hh_mixed_with_by_day) # Populate each timestep with relevant bubble household ID update_hh_visit_plan!(hh_visit_plan, @@ -254,66 +287,11 @@ function three_household_faithful_bubble_visit_plan!(hh_visit_plan::Array{Array{ hh_mixed_with_by_day[hh_itr] = [] end - # Support bubble paris need a non-support bubble household. - # Get lists of households in support bubble and not in support bubble - hh_in_support_bubble, - hh_not_in_support_bubble = get_hh_support_bubble_status_vecs(info_per_household) - - # Shuffle order of hh_not_in_support_bubble - shuffle!(rng,hh_not_in_support_bubble) - - # Initialise index counter for assigning non-support bubble households to a triplet - # with two households that are in a support bubble - hh_not_in_support_bubble_idx = 1 - - # Support bubble pairs can only form christmas bubble with a non-support bubble household. - support_bubble_allocated_to_christmas_bubble = zeros(Bool,length(hh_in_support_bubble)) - for support_bubble_hh_itr = 1:length(hh_in_support_bubble) - # Get household ID of index househould in this loop iteration - support_bubble_hh_ID = hh_in_support_bubble[support_bubble_hh_itr] - - # Error check - if info_per_household[support_bubble_hh_ID].household_ID != support_bubble_hh_ID - error("support_bubble_hh_ID, $support_bubble_hh_ID, and info_per_household[support_bubble_hh_ID].household_ID $(info_per_household[support_bubble_hh_ID].household_ID) do not match.") - end - - # Check if already assigned to christmas bubble - if support_bubble_allocated_to_christmas_bubble[support_bubble_hh_itr] == false - - # If yet to be assigned, take next household in list of hh_not_in_support_bubble - third_hh_in_bubble_ID = hh_not_in_support_bubble[hh_not_in_support_bubble_idx] - hh_not_in_support_bubble_idx += 1 # Increment index access counter - - # Update assignment status of other household in support bubble - other_hh_in_support_bubble_ID = info_per_household[support_bubble_hh_ID].support_bubble_household_ID # Get ID of other household in support bubble - support_bubble_allocated_to_christmas_bubble[hh_in_support_bubble .== other_hh_in_support_bubble_ID] .= true - # Find relevant index in list of household IDs in support bubbles that matches - # the ID of household in this support bubble - - # Update assignment status of index household - support_bubble_allocated_to_christmas_bubble[support_bubble_hh_itr] = true - - # Do contact assignment for household triplet - # Update hh_mixed_with_by_day - christmas_bubble_hh_IDs = [support_bubble_hh_ID; - other_hh_in_support_bubble_ID; - third_hh_in_bubble_ID] - update_visitation_schedule!(christmas_bubble_hh_IDs, - hh_mixed_with_by_day) - - end - end - - # Once all support bubbles allocated a triple, remaining households can be allocated as triples. - remaining_hh_to_assign_to_bubble = length(hh_not_in_support_bubble) - (hh_not_in_support_bubble_idx - 1) - n_triples = ceil(Int64,remaining_hh_to_assign_to_bubble/3) - for hh_grp_itr = 1:n_triples - start_idx = hh_not_in_support_bubble_idx + ((hh_grp_itr-1)*3) # Don't need to +1 as hh_not_in_support_bubble_idx one larger than actual number of non-support bubble hh allocated to christmas bubbles - end_idx = min((hh_not_in_support_bubble_idx - 1) + (hh_grp_itr*3),length(hh_not_in_support_bubble)) - household_ID_slice = hh_not_in_support_bubble[start_idx:end_idx] - update_visitation_schedule!(household_ID_slice, - hh_mixed_with_by_day) - end + # Construct Christmas bubbles and update visit schedule + construct_christmas_bubbles_and_update_visit_schedule!(rng, + n_households, + info_per_household, + hh_mixed_with_by_day) # Populate each timestep with relevant bubble household ID update_hh_visit_plan!(hh_visit_plan, @@ -324,6 +302,7 @@ function three_household_faithful_bubble_visit_plan!(hh_visit_plan::Array{Array{ info_per_household, mixing_start_time, mixing_end_time) + return nothing end @@ -346,229 +325,116 @@ function three_household_fixed_bubble_visit_plan!(hh_visit_plan::Array{Array{Arr hh_mixed_with_by_day[hh_itr] = [] end - # Get lists of households in support bubble and not in support bubble - hh_in_support_bubble, - hh_not_in_support_bubble = get_hh_support_bubble_status_vecs(info_per_household) - # Get list of all households n_hh = length(info_per_household) hh_ID_vec = collect(1:n_hh) - # Get number of households in & not in support bubbles - n_hh_in_support_bubble = length(hh_in_support_bubble) - n_hh_not_in_support_bubble = length(hh_not_in_support_bubble) - - # Get visit schedule entries for just households not in support bubbles - hh_not_in_support_bubble_mixed_with_by_day = hh_mixed_with_by_day[hh_not_in_support_bubble] - #============================= Bubble formation structure # Iterate over each household - - # If in support bubble, - # - Check if triplet is already assigned. - # - If not: - # - sample one household that is not in a support bubble - # - That completes the triplet - - # If not in a support bubble - - Check if triplet is already assigned. - - If not: - - If have one spot spare, sample a household from hh_not_in_support_bubble - that also has a spare slot - - If has two spots spare, sample a household from hh_not_in_support_bubble - that also has a spare slot. And then repeat. + - Check if triplet is already assigned. + - If not: + - If have one spot spare, sample a household from hh_bubble_assignment_IDs + that also has a spare slot + - If has two spots spare, sample a household from hh_bubble_assignment_IDs + that also has a spare slot. And then repeat. =============================# - # Intialise vectors for allocation - n_hh_assigned_to_xmas_bubbles = zeros(Int64,n_hh) - n_hh_assigned_to_xmas_bubbles_hh_not_in_support_bubble = zeros(Int64,n_hh_not_in_support_bubble) - - # Initialise BitVectors for allocation - bitvector_hh_with_xmas_bubble_space = BitVector(undef,n_hh) - bitvector_hh_not_in_support_bubble_with_two_xmas_bubble_spaces = BitVector(undef,n_hh_not_in_support_bubble) - bitvector_hh_not_in_support_bubble_with_one_xmas_bubble_space = BitVector(undef,n_hh_not_in_support_bubble) + # Have a spare slot counter. Begins at 2, will be incremented down + # in bubble assignment loop + household_bubble_spaces_available = 2*ones(Int64,n_hh) # Iterate over each household - for first_hh_in_bubble_ID = 1:n_hh - - # Populate temporary arrays to be used to get eligibile households for bubble selection - n_hh_assigned_to_xmas_bubbles_hh_not_in_support_bubble .= length.(hh_not_in_support_bubble_mixed_with_by_day) - bitvector_hh_not_in_support_bubble_with_two_xmas_bubble_spaces .= n_hh_assigned_to_xmas_bubbles_hh_not_in_support_bubble .== 0 - bitvector_hh_not_in_support_bubble_with_one_xmas_bubble_space .= n_hh_assigned_to_xmas_bubbles_hh_not_in_support_bubble .== 1 - - n_hh_assigned_to_xmas_bubbles .= length.(hh_mixed_with_by_day) - bitvector_hh_with_xmas_bubble_space .= n_hh_assigned_to_xmas_bubbles .< 2 - - # Update eligible households to be selected. - hh_not_in_support_bubble_with_current_size_zero_xmas_bubble = hh_not_in_support_bubble[bitvector_hh_not_in_support_bubble_with_two_xmas_bubble_spaces] - hh_not_in_support_bubble_with_current_size_one_xmas_bubble = hh_not_in_support_bubble[bitvector_hh_not_in_support_bubble_with_one_xmas_bubble_space] - hh_with_space_in_xmas_bubble = hh_ID_vec[bitvector_hh_with_xmas_bubble_space] - - # If in support bubble, check if triplet is already assigned - if info_per_household[first_hh_in_bubble_ID].in_support_bubble == true - # If not, sample one household that is not in a support bubble - if length(hh_mixed_with_by_day[first_hh_in_bubble_ID]) == 0 - # Get ID of other household in support bubble - second_hh_in_bubble_ID = info_per_household[first_hh_in_bubble_ID].support_bubble_household_ID - - # Sample a household from hh_not_in_support_bubble - # - If no spare slots, no more assignments are made. - if length(hh_not_in_support_bubble_with_current_size_zero_xmas_bubble) > 0 - third_hh_in_bubble_ID = rand(rng,hh_not_in_support_bubble_with_current_size_zero_xmas_bubble) - - # Error if household does not have two spare slots - if length(hh_mixed_with_by_day[third_hh_in_bubble_ID]) > 0 - error("Invalid entry in hh_not_in_support_bubble_with_current_size_zero_xmas_bubble.") - #third_hh_in_bubble_ID = rand(rng,hh_not_in_support_bubble_with_current_size_zero_xmas_bubble) - end - - # Do contact assignment for household triplet - # Update hh_mixed_with_by_day - christmas_bubble_hh_IDs = [first_hh_in_bubble_ID; - second_hh_in_bubble_ID; - third_hh_in_bubble_ID] - update_visitation_schedule!(christmas_bubble_hh_IDs, - hh_mixed_with_by_day) - end - elseif length(hh_mixed_with_by_day[first_hh_in_bubble_ID]) != 2 - # Error check. Not possible for support bubble household to only be allocated - # one other household to meet - error("Support bubble household (ID $first_hh_in_bubble_ID) not previously assigned a full triplet: $(hh_mixed_with_by_day[first_hh_in_bubble_ID])") - end - # If length(hh_mixed_with_by_day[first_hh_in_bubble_ID]) == 2 then no assignments needed - else - # Error check - if length(hh_mixed_with_by_day[first_hh_in_bubble_ID]) > 2 - error("More than two households visited by hh $first_hh_in_bubble_ID: $(hh_mixed_with_by_day[first_hh_in_bubble_ID])") + for hh_ID = 1:n_hh + # Only enter loop if index household has spaces to be assigned + if household_bubble_spaces_available[hh_ID] > 0 + + # Get households with spare slot + eligible_households = hh_ID_vec[household_bubble_spaces_available .> 0] + + # Remove hh_ID from eligible households + filter!(x->x≠hh_ID,eligible_households) + + # For index household, check if in support bubble + # Remove ID of support bubble household from vector used to sample + # christmas bubble household IDs + if info_per_household[hh_ID].in_support_bubble == true + support_bubble_hh_ID = info_per_household[hh_ID].support_bubble_household_ID + filter!(x->x≠support_bubble_hh_ID,eligible_households) end - # Check if triplet is already assigned. - # - If not, it will enter loop - if length(hh_mixed_with_by_day[first_hh_in_bubble_ID]) == 1 - # - If have one spot spare, sample a household from hh_not_in_support_bubble - # that also has a spare slot - # - If no spare slots, no more assignments are made. - if (length(hh_not_in_support_bubble_with_current_size_one_xmas_bubble) > 1) || - ( (length(hh_not_in_support_bubble_with_current_size_one_xmas_bubble) == 1) && - (hh_not_in_support_bubble_with_current_size_one_xmas_bubble[1] != first_hh_in_bubble_ID) ) - second_hh_in_bubble_ID = rand(rng,hh_not_in_support_bubble_with_current_size_one_xmas_bubble) - - # Resample if drawn value is same as first_hh_in_bubble_ID - while (second_hh_in_bubble_ID == first_hh_in_bubble_ID) - second_hh_in_bubble_ID = rand(rng,hh_not_in_support_bubble_with_current_size_one_xmas_bubble) - end + # If elgibile household > 0, sample from those eligible households + if length(eligible_households) > 0 - # Error if household does not have spare slots - if length(hh_mixed_with_by_day[second_hh_in_bubble_ID]) == 2 - error("Invalid entry in hh_not_in_support_bubble_with_current_size_one_xmas_bubble.") - #second_hh_in_bubble_ID = rand(rng,hh_not_in_support_bubble_with_current_size_one_xmas_bubble) - end + sampled_hh_ID_vec = rand(rng,eligible_households,household_bubble_spaces_available[hh_ID]) + + # Check. If two households sampled, check they are not in the same support bubble. + # If true, resample second household (if enough eligible households) + if household_bubble_spaces_available[hh_ID] == 2 + first_proposed_bubble_hh_ID = sampled_hh_ID_vec[1] - # Update visitation schedules for both first_hh_in_bubble_ID & second_hh_in_bubble_ID - append!(hh_mixed_with_by_day[first_hh_in_bubble_ID],second_hh_in_bubble_ID) - append!(hh_mixed_with_by_day[second_hh_in_bubble_ID],first_hh_in_bubble_ID) + if info_per_household[first_proposed_bubble_hh_ID].in_support_bubble == true + first_proposed_bubble_hh_support_bubble_hh_ID = info_per_household[first_proposed_bubble_hh_ID].support_bubble_household_ID + if length(eligible_households) > 2 + while first_proposed_bubble_hh_support_bubble_hh_ID == sampled_hh_ID_vec[2] + sampled_hh_ID_vec[2] = rand(rng,eligible_households) + end + else + # No other households may be sampled. Restrict list to first sampled household + sampled_hh_ID_vec = first_proposed_bubble_hh_ID + end + end end - elseif length(hh_mixed_with_by_day[first_hh_in_bubble_ID]) == 0 - # First sample a household - # - If no spare slots, no more assignments are made. - if (length(hh_with_space_in_xmas_bubble) > 1) || - ( (length(hh_with_space_in_xmas_bubble) == 1) && - (hh_with_space_in_xmas_bubble[1] != first_hh_in_bubble_ID) ) + for sampled_hh_itr = 1:length(sampled_hh_ID_vec) - # Sample a households - second_hh_in_bubble_ID = rand(rng,hh_with_space_in_xmas_bubble) + # Initialise christmas_bubble_hh_IDs + christmas_bubble_hh_IDs = Int64[] - # Resample if drawn value is same as first_hh_in_bubble_ID - while (second_hh_in_bubble_ID == first_hh_in_bubble_ID) - second_hh_in_bubble_ID = rand(rng,hh_with_space_in_xmas_bubble) - end + # Add household selected to be part of bubble to christmas_bubble_hh_IDs + append!(christmas_bubble_hh_IDs,hh_ID) - # Error if household does not have spare slots - if length(hh_mixed_with_by_day[second_hh_in_bubble_ID]) == 2 - error("Invalid entry in hh_with_space_in_xmas_bubble.") - #second_hh_in_bubble_ID = rand(rng,hh_with_space_in_xmas_bubble) - end + # For current loop, get ID of sampled household to join bubble + sampled_hh_ID = sampled_hh_ID_vec[sampled_hh_itr] - # - If sampled household in a support bubble, that will complete the triplet - if info_per_household[second_hh_in_bubble_ID].in_support_bubble == true + # Decrease spare household slot counter for index household + # and sampled household + household_bubble_spaces_available[hh_ID] -= 1 + household_bubble_spaces_available[sampled_hh_ID] -= 1 - # Error check. As household is in support bubble, it should either have fully assigned - # triplet or not have any household meets yet assigned - if length(hh_mixed_with_by_day[second_hh_in_bubble_ID]) == 1 - error("Support bubble household (ID $second_hh_in_bubble_ID) not previously assigned a full triplet: $(hh_mixed_with_by_day[second_hh_in_bubble_ID])") - end + # Add sampled household selected to be part of bubble to christmas_bubble_hh_IDs + append!(christmas_bubble_hh_IDs,sampled_hh_ID) - # Get ID of other household in support bubble - third_hh_in_bubble_ID = info_per_household[second_hh_in_bubble_ID].support_bubble_household_ID - - # Do contact assignment for household triplet - # Update hh_mixed_with_by_day - christmas_bubble_hh_IDs = [first_hh_in_bubble_ID; - second_hh_in_bubble_ID; - third_hh_in_bubble_ID] - update_visitation_schedule!(christmas_bubble_hh_IDs, - hh_mixed_with_by_day) - else - - # - If sampled household not from a suppot bubble, assign pair of households as vitising each other - append!(hh_mixed_with_by_day[first_hh_in_bubble_ID],second_hh_in_bubble_ID) - append!(hh_mixed_with_by_day[second_hh_in_bubble_ID],first_hh_in_bubble_ID) - - # # Update hh_not_in_support_bubble_with_current_size_one_xmas_bubble - # hh_not_in_support_bubble_with_current_size_one_xmas_bubble = hh_not_in_support_bubble[length.(hh_mixed_with_by_day[hh_not_in_support_bubble]) .== 1] - - # Populate temporary arrays to be used to get eligibile households for bubble selection - n_hh_assigned_to_xmas_bubbles_hh_not_in_support_bubble .= length.(hh_not_in_support_bubble_mixed_with_by_day) - bitvector_hh_not_in_support_bubble_with_one_xmas_bubble_space .= n_hh_assigned_to_xmas_bubbles_hh_not_in_support_bubble .== 1 - hh_not_in_support_bubble_with_current_size_one_xmas_bubble = hh_not_in_support_bubble[bitvector_hh_not_in_support_bubble_with_one_xmas_bubble_space] - - # - Then sample second household from hh_not_in_support_bubble that also has a spare slot. - # - If no spare slots, no more assignments are made. - if (length(hh_not_in_support_bubble_with_current_size_one_xmas_bubble) > 2) || # If more than two entries, is an eligible household to be selected - ( (length(hh_not_in_support_bubble_with_current_size_one_xmas_bubble) == 1) && # If only one eligible household in list, check it has not already been selected - (hh_not_in_support_bubble_with_current_size_one_xmas_bubble[1] != first_hh_in_bubble_ID) && - (hh_not_in_support_bubble_with_current_size_one_xmas_bubble[1] != second_hh_in_bubble_ID)) || - ( (length(hh_not_in_support_bubble_with_current_size_one_xmas_bubble) == 2) && # If two eligible households in list, check both have not been selected - ( ( (hh_not_in_support_bubble_with_current_size_one_xmas_bubble[1] != first_hh_in_bubble_ID) && (hh_not_in_support_bubble_with_current_size_one_xmas_bubble[2] != first_hh_in_bubble_ID) ) || - ( (hh_not_in_support_bubble_with_current_size_one_xmas_bubble[1] != second_hh_in_bubble_ID) && (hh_not_in_support_bubble_with_current_size_one_xmas_bubble[2] != second_hh_in_bubble_ID) ) )) - - # Sample a household to be third household on non-exclusive bubble - # for index household - third_hh_in_bubble_ID = rand(rng,hh_not_in_support_bubble_with_current_size_one_xmas_bubble) - - # Resample if drawn value is same as either first_hh_in_bubble_ID - # or second__hh_in_bubble_ID - while (third_hh_in_bubble_ID == first_hh_in_bubble_ID) || - (third_hh_in_bubble_ID == second_hh_in_bubble_ID) - third_hh_in_bubble_ID = rand(rng,hh_not_in_support_bubble_with_current_size_one_xmas_bubble) - end + # For index household, check if in support bubble + if (info_per_household[hh_ID].in_support_bubble == true) + # If true, add support bubble households to be part of bubble to christmas_bubble_hh_IDs + append!(christmas_bubble_hh_IDs,support_bubble_hh_ID) + # Decrease spare household slot counter for support bubble household + household_bubble_spaces_available[support_bubble_hh_ID] -= 1 + end - # Error if household does not have spare slots - if length(hh_mixed_with_by_day[third_hh_in_bubble_ID]) == 2 - error("Invalid entry in hh_not_in_support_bubble_with_current_size_one_xmas_bubble.") - #third_hh_in_bubble_ID = rand(rng,hh_not_in_support_bubble_with_current_size_one_xmas_bubble) - end + # Check if sampled household in support bubble + if info_per_household[sampled_hh_ID].in_support_bubble == true + sampled_hh_support_bubble_household_ID = info_per_household[sampled_hh_ID].support_bubble_household_ID - # Once sampled, assign pair of households as visiting each other - append!(hh_mixed_with_by_day[first_hh_in_bubble_ID],third_hh_in_bubble_ID) - append!(hh_mixed_with_by_day[third_hh_in_bubble_ID],first_hh_in_bubble_ID) - end + # Decrease spare household slot counter for support bubble household + household_bubble_spaces_available[sampled_hh_support_bubble_household_ID] -= 1 + + # Add household selected to be part of bubble to christmas_bubble_hh_IDs + append!(christmas_bubble_hh_IDs,sampled_hh_support_bubble_household_ID) end + + # Do contact assignment for household triplet + # Update hh_mixed_with_by_day + update_visitation_schedule_scenario_D!(christmas_bubble_hh_IDs, + hh_mixed_with_by_day) end end end - - # Error check at end of assignment - if length(hh_mixed_with_by_day[first_hh_in_bubble_ID]) > 2 - error("Too many households assigned to bubble for hh $first_hh_in_bubble_ID: $(hh_mixed_with_by_day[first_hh_in_bubble_ID])") - end end - # Populate each timestep with relevant bubble household ID update_hh_visit_plan!(hh_visit_plan, hh_mixed_with_by_day, @@ -578,6 +444,7 @@ function three_household_fixed_bubble_visit_plan!(hh_visit_plan::Array{Array{Arr info_per_household, mixing_start_time, mixing_end_time) + return nothing end function three_household_unfaithful_bubble_visit_plan!(hh_visit_plan::Array{Array{Array{Int64,1},1},2}, @@ -595,11 +462,6 @@ function three_household_unfaithful_bubble_visit_plan!(hh_visit_plan::Array{Arra # Get number of households n_households = length(info_per_household) - # Support bubble paris need a non-support bubble household. - # Get lists of households in support bubble and not in support bubble - hh_in_support_bubble, - hh_not_in_support_bubble = get_hh_support_bubble_status_vecs(info_per_household) - # Within Christmas bubble period, create new household triplets each day # and assign to visit schedule. # If outside Christmas bubble period, gatherings will be with support bubble households only @@ -613,61 +475,11 @@ function three_household_unfaithful_bubble_visit_plan!(hh_visit_plan::Array{Arra hh_mixed_with_by_day[hh_itr] = [] end - # Shuffle order of hh_not_in_support_bubble - shuffle!(rng,hh_not_in_support_bubble) - - # Initialise index counter for assigning non-support bubble households to a triplet - # with two households that are in a support bubble - hh_not_in_support_bubble_idx = 1 - - # Support bubble pairs can only form christmas bubble with a non-support bubble household. - support_bubble_allocated_to_christmas_bubble = zeros(Bool,length(hh_in_support_bubble)) - for support_bubble_hh_itr = 1:length(hh_in_support_bubble) - # Get household ID of index househould in this loop iteration - support_bubble_hh_ID = hh_in_support_bubble[support_bubble_hh_itr] - - # Error check - if info_per_household[support_bubble_hh_ID].household_ID != support_bubble_hh_ID - error("support_bubble_hh_ID, $support_bubble_hh_ID, and info_per_household[support_bubble_hh_ID].household_ID $(info_per_household[support_bubble_hh_ID].household_ID) do not match.") - end - - # Check if already assigned to christmas bubble - if support_bubble_allocated_to_christmas_bubble[support_bubble_hh_itr] == false - - # If yet to be assigned, take next household in list of hh_not_in_support_bubble - third_hh_in_bubble_ID = hh_not_in_support_bubble[hh_not_in_support_bubble_idx] - hh_not_in_support_bubble_idx += 1 # Increment index access counter - - # Update assignment status of other household in support bubble - other_hh_in_support_bubble_ID = info_per_household[support_bubble_hh_ID].support_bubble_household_ID # Get ID of other household in support bubble - support_bubble_allocated_to_christmas_bubble[hh_in_support_bubble .== other_hh_in_support_bubble_ID] .= true - # Find relevant index in list of household IDs in support bubbles that matches - # the ID of household in this support bubble - - # Update assignment status of index household - support_bubble_allocated_to_christmas_bubble[support_bubble_hh_itr] = true - - # Do contact assignment for household triplet - # Update hh_mixed_with_by_day - christmas_bubble_hh_IDs = [support_bubble_hh_ID; - other_hh_in_support_bubble_ID; - third_hh_in_bubble_ID] - update_visitation_schedule!(christmas_bubble_hh_IDs, - hh_mixed_with_by_day) - - end - end - - # Once all support bubbles allocated a triple, remaining households can be allocated as triples. - remaining_hh_to_assign_to_bubble = length(hh_not_in_support_bubble) - (hh_not_in_support_bubble_idx - 1) - n_triples = ceil(Int64,remaining_hh_to_assign_to_bubble/3) - for hh_grp_itr = 1:n_triples - start_idx = hh_not_in_support_bubble_idx + ((hh_grp_itr-1)*3) # Don't need to +1 as hh_not_in_support_bubble_idx one larger than actual number of non-support bubble hh allocated to christmas bubbles - end_idx = min((hh_not_in_support_bubble_idx - 1) + (hh_grp_itr*3),length(hh_not_in_support_bubble)) - household_ID_slice = hh_not_in_support_bubble[start_idx:end_idx] - update_visitation_schedule!(household_ID_slice, - hh_mixed_with_by_day) - end + # Construct Christmas bubbles and update visit schedule + construct_christmas_bubbles_and_update_visit_schedule!(rng, + n_households, + info_per_household, + hh_mixed_with_by_day) # Update household visit schedule for each person for person_itr = 1:n_persons