Esempio n. 1
0
            k, 6] - ics[k, 7] - ics[k, 9]

    # compute contacts matrices
    Cs = {}
    C  = country_dict["contacts_home"]   + country_dict["contacts_work"] + \
         country_dict["contacts_school"] + country_dict["contacts_other_locations"]
    date, dates = start_date, [start_date]
    for i in range((end_date - start_date).days):
        Cs[date] = C
        date += timedelta(days=1)
        dates.append(date)

    # run the baseline solution with no vaccine
    sol_baseline, Vt, ws = integrate_BV(ics, (end_date - start_date).days, R0,
                                        eps, mu, omega, chi, f, IFR, Delta,
                                        1.0, 0.0, 0.0, 0.0, 0.0, 0.0, Cs,
                                        country_dict["Nk"], "homogeneous",
                                        "vaccine_rate", dates)

    # run different rollout speeds
    for rV in rVs:
        print("\t", rV)
        data[country][rV] = dict()

        # run different r value
        for r in rs:
            print("\t\t", r)
            data[country][rV][r] = dict()

            # run different models
            for model in models:
            k, 6] - ics[k, 7] - ics[k, 9]

    # compute contacts matrices
    Cs = {}
    C  = country_dict["contacts_home"]   + country_dict["contacts_work"] + \
         country_dict["contacts_school"] + country_dict["contacts_other_locations"]
    date, dates = start_date, [start_date]
    for i in range((end_date - start_date).days):
        Cs[date] = C
        date += timedelta(days=1)
        dates.append(date)

    # run the baseline (no behavior)
    sol_baseline, Vt, vs = integrate_BV(ics, (end_date - start_date).days, R0,
                                        eps, mu, omega, chi, f, IFR, Delta,
                                        1.0, 0.0, 0.0, 0.0, 0.0, 0.0, Cs,
                                        country_dict["Nk"], "old_first",
                                        "vaccine_rate", dates)

    # run different rollout speeds
    for gamma in gammas:
        print("\t", gamma)
        data[country][gamma] = dict()

        # run different strategies
        for strategy in vaccination_strategies:
            print("\t\t", strategy)
            data[country][gamma][strategy] = []

            # run different alphas
            for i in range(len(alpha_s)):
Esempio n. 3
0
        ics[k, 9] = r0 * country_dict["Nk"][k]
        ics[k, 0] = country_dict["Nk"][k] - ics[k, 4] - ics[k, 5] - ics[
            k, 6] - ics[k, 7] - ics[k, 9]

    R0 = np.random.uniform(0.8, 2.2)
    Delta = np.random.randint(14, 25)
    solution, Vt, vs = integrate_BV(ics, (end_date - start_date).days,
                                    R0,
                                    eps,
                                    mu,
                                    omega,
                                    chi,
                                    f,
                                    IFR,
                                    Delta,
                                    r,
                                    alpha,
                                    gamma,
                                    rV,
                                    VES,
                                    VEM,
                                    Cs,
                                    country_dict["Nk"],
                                    vaccination_strategy="homogeneous",
                                    model="vaccine_rate",
                                    dates=dates)

    # sum over age and create df
    solution_age = solution.sum(axis=0)
    df_deaths = pd.DataFrame(data={
        "deaths": np.diff(solution_age[11]),
        "dates": dates[1:]