B_opt_country = get_B_policy( file_B_opt, country, 'Uncontained', ) Ng = B_opt_country.shape[0] assert len( age_groups ) == 9, 'Check the defined age-groups. Something is wrong there.' ref_obj = epid_sim( model_type=model_type, B=B_opt_country, Gamma=Gamma, Sigma=Sigma, dir_save_plots_main=dir_save_plots, country='Iran', policy_list=['Uncontained'], policy_switch_times=[0], x0=x0_vec, t_end=t_end, str_policy='Uncontained', group_labels=age_groups, ) # %% current estimate t_s = 60 list_t_switch = [0] + list(np.arange(t_s, t_s + 30 * 7, 30)) str_ts = '_start_' + str(t_s) + 'D' all_containment_list = [ 'Uncontained', 1.5, 1.2,
B_opt_country = get_B_policy( file_B_opt, country, 'Uncontained', ) Ng = B_opt_country.shape[0] assert len( age_groups ) == 9, 'Check the defined age-groups. Something is wrong there.' ref_obj = epid_sim( model_type=model_type, B=B_opt_country, Gamma=Gamma, Sigma=Sigma, dir_save_plots_main=dir_save_plots_main, country=country, policy_list=my_policy, policy_switch_times=[0], x0=x0_vec, t_end=t_end, str_policy=str_policy, group_labels=age_groups, ) list_sol_I = [] list_sol_R = [] # pc1 = 45. pc2 = pc1 + 10 x0R_array = list(np.arange(0., pc1, 5.0)/100) +\ list(np.arange(pc1, pc2, 1.0)/100) for x0R in x0R_array: print('x0R --------------> ', x0R)
file_B_opt, country, 'Uncontained', ) Ng = B_opt_country.shape[0] assert len( age_groups ) == 9, 'Check the defined age-groups. Something is wrong there.' dir_save = Path(dir_save_plots, 'T_I_variable', str(T_I)) epid_obj = epid_sim( model_type=model_type, B=B_opt_country, Gamma=Gamma, Sigma=Sigma, dir_save_plots_main=dir_save, country=country, policy_list=all_containment_list, policy_switch_times=list_t_switch, x0=x0_vec, t_end=t_end, str_policy=policy_name, group_labels=age_groups, ) sol_agg_I = epid_obj.sol_agg_dict['I'] sol_agg_R = epid_obj.sol_agg_dict['R'] list_sol_I.append(sol_agg_I) list_sol_R.append(sol_agg_R) # dir_save_plots.mkdir(exist_ok=True, parents=True) filesave_I = Path(dir_save_plots, model_type + '_' + country + '_I_AGG_ALL_T_I.png') filesave_R = Path(dir_save_plots,
# Sigma = Gamma *10 model_type = 'SIR' #%% reference policy: uncontained policy_name = 'Uncontained' list_t_switch = [0,] all_containment_list = ['Uncontained',] ref_obj = epid_sim(model_type=model_type, B=B_opt_SIR, Gamma=Gamma, Sigma=Sigma, dir_save_plots_main=dir_save_plots_main, country='Germany', policy_list=all_containment_list, policy_switch_times=list_t_switch, x0=x0_vec, t_end=t_end, str_policy=policy_name, group_labels=age_groups,) ref_obj.plot_agg() ref_obj.plot_strat() ref_obj.plot_strat_multiax() print('*************************************************************') #%% Uncontained_then_switching_R0 list_t_switch = [0, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360, ] all_containment_list = ['Uncontained', 'R0_is_1', 'Uncontained', 'R0_is_1',
print(country) B_opt_country = get_B_policy(file_B_opt, country, 'Uncontained', ) Gamma = load_mat(file_B_opt, 'Gamma') Ng = B_opt_country.shape[0] assert len(age_groups) == 9, 'Check the defined age-groups. Something is wrong there.' if model_type == 'SEIR': Sigma = load_mat(file_B_opt, 'Sigma') else: Sigma = np.zeros((Ng, Ng)) epid_obj = epid_sim(model_type=model_type, B=B_opt_country, Gamma=Gamma, Sigma=Sigma, dir_save_plots_main=dir_save_plots, country=country, policy_list=all_policies, policy_switch_times=list_t_switch, x0=x0_vec, t_end=t_end, str_policy='00_OVERALL', group_labels=age_groups,) sol_agg_I = epid_obj.sol_agg_dict['I'] sol_agg_R = epid_obj.sol_agg_dict['R'] list_sol_I.append(sol_agg_I) list_sol_R.append(sol_agg_R) # dir_save_plots.mkdir(exist_ok=True, parents=True) filesave_I = Path(dir_save_plots, model_type + '_I_AGG_ALL_countries.png') filesave_R = Path(dir_save_plots, model_type + '_R_AGG_ALL_countries.png') # plot aggregate plots to compare all policies.