def simulation_setup(cb, species_details, site_vector_props, max_larval_capacity=4e8): site_dir = os.path.join('sites', 'all') # directories cb.update_params({ "Demographics_Filenames": [ os.path.join(site_dir, "demographics.json"), os.path.join(site_dir, "demographics_net_overlay.json") ], "Air_Temperature_Filename": os.path.join(site_dir, "air_temperature_daily.bin"), "Land_Temperature_Filename": os.path.join(site_dir, "air_temperature_daily.bin"), "Rainfall_Filename": os.path.join(site_dir, "rainfall_daily.bin"), "Relative_Humidity_Filename": os.path.join(site_dir, "relative_humidity_daily.bin") }) # Find vector proportions for each vector set_params_by_species(cb.params, [name for name in species_details.keys()]) larval_habs_per_site = {"NodeID": site_vector_props["node_id"]} for species_name, species_modifications in species_details.items(): set_species_param(cb, species_name, "Adult_Life_Expectancy", 20) set_species_param(cb, species_name, 'Vector_Sugar_Feeding_Frequency', 'VECTOR_SUGAR_FEEDING_EVERY_DAY') for param, val in species_modifications.items(): if param == "habitat_split": new_vals = { hab: hab_prop * max_larval_capacity for hab, hab_prop in val.items() } set_species_param(cb, species_name, "Larval_Habitat_Types", new_vals) larval_habs_per_site.update({ ".".join([species_name, hab]): site_vector_props[species_name] for hab in val.keys() }) else: set_species_param(cb, species_name, param, val) scale_larval_habitats(cb, pd.DataFrame(larval_habs_per_site))
def update_vector_params(cb): set_params_by_species(cb.params, ['minimus', 'dirus']) update_species_param(cb, 'minimus', 'Larval_Habitat_Types', {'WATER_VEGETATION': 2e7}, overwrite=True) update_species_param(cb, 'minimus', 'Acquire_Modifier', 0.8, overwrite=False) update_species_param(cb, 'minimus', 'Adult_Life_Expectancy', 25, overwrite=False) # target: 12 update_species_param(cb, 'dirus', 'Larval_Habitat_Types', { 'CONSTANT': 1e7, 'TEMPORARY_RAINFALL': 7e7 }, overwrite=True) update_species_param(cb, 'dirus', 'Adult_Life_Expectancy', 30, overwrite=False) # target: 14 update_species_param(cb, 'minimus', 'Anthropophily', 0.5, overwrite=False) update_species_param(cb, 'dirus', 'Anthropophily', 0.5, overwrite=False) capacity_dist_per_year = { "Times": [0, 1, 245, 275, 364], "Values": [0.2, 0.2, 0.7, 3, 3] } linear_spline = { "LINEAR_SPLINE": { "Capacity_Distribution_Number_Of_Years": 1, "Capacity_Distribution_Over_Time": capacity_dist_per_year, "Max_Larval_Capacity": 3e7 } } update_species_param(cb, 'minimus', 'Larval_Habitat_Types', linear_spline, overwrite=False)
def __call__(self, cb): return set_params_by_species(cb.params, self.species, 'MALARIA_SIM')
"HEG_Homing_Rate": 0.0, "HEG_Fecundity_Limiting": 0.0, "HEG_Model": "OFF", "x_Temporary_Larval_Habitat": 1, "Egg_Hatch_Density_Dependence": "NO_DENSITY_DEPENDENCE", "Enable_Temperature_Dependent_Egg_Hatching": 0, "Enable_Egg_Mortality": 0, "Enable_Drought_Egg_Hatch_Delay": 0, "Temperature_Dependent_Feeding_Cycle": "NO_TEMPERATURE_DEPENDENCE", "Genome_Markers": [] } params = cohort_params.copy() params.update(disease_params) params.update(larval_habitat.params) set_params_by_species(params, ["arabiensis", "funestus", "gambiae"]) # -------------------------------------------------------------- # Individual-mosquito model (rather than cohort-based model) # -------------------------------------------------------------- individual_params = cohort_params.copy() individual_params["Vector_Sampling_Type"] = "TRACK_ALL_VECTORS" # -------------------------------------------------------------- # Using VECTOR_SIM as a vivax model # -------------------------------------------------------------- vivax_semitropical_params = disease_params.copy() vivax_semitropical_params.update({ "Incubation_Period_Distribution": "FIXED_DURATION",
# Malaria disease + drug parameters # -------------------------------------------------------------- disease_params = { "Malaria_Model": "MALARIA_MECHANISTIC_MODEL", "Malaria_Strain_Model": "FALCIPARUM_RANDOM_STRAIN" } disease_params.update(infection.params) disease_params.update(immunity.params) disease_params.update(symptoms.params) params = copy.deepcopy(disease_params) params["PKPD_Model"] = "CONCENTRATION_VERSUS_TIME" params["Malaria_Drug_Params"] = drug_params params["Genome_Markers"] = [] set_params_by_species(params, ["arabiensis", "funestus", "gambiae"], "MALARIA_SIM") # -------------------------------------------------------------- # Innate immunity only # -------------------------------------------------------------- innate_only = copy.deepcopy(params) innate_only.update({ "Antibody_Capacity_Growth_Rate": 0, "Max_MSP1_Antibody_Growthrate": 0, "Min_Adapted_Response": 0 })