Skip to content

Commit

Permalink
Added AgeBasedHINT instead of IP-based.
Browse files Browse the repository at this point in the history
Update requirements.txt for _hint example.
  • Loading branch information
Jonathan Bloedow committed Dec 6, 2023
1 parent 9105bb7 commit a82b1d8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
34 changes: 29 additions & 5 deletions examples/future_campaign/multi_sweep_hint.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def build_camp():
node_ids=[1],
repetitions= 5,
timesteps_between_repetitions=30,
ind_property_restrictions=["Region:Rural"] # just to show we can and stuff
#ind_property_restrictions=["Region:Rural"] # just to show we can and stuff
)
camp.add(ob_event)

Expand Down Expand Up @@ -130,6 +130,7 @@ def build_demog():

demog = Demographics.from_template_node(lat=0, lon=0, pop=10000, name=1, forced_id=1)
# We're getting all our demographics from a static file overlay.
"""
demog.AddIndividualPropertyAndHINT( Property="Region",
Values = [ "Rural", "Urban" ],
InitialDistribution = [ 0.8, 0.2 ],
Expand All @@ -142,6 +143,16 @@ def build_demog():
[ 0.1, 1 ]
]
)
"""
demog.AddAgeDependentTransmission(
Age_Bin_Edges_In_Years = [0, 5, 20, 60, -1],
TransmissionMatrix = [
[0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 5.0]
]
)

return demog

Expand Down Expand Up @@ -300,15 +311,26 @@ def get_sweep_list_duration():
sweep_list.append({'start_day_offset': c[0], 'efficacy': c[1], 'coverage': c[2], 'decay_constant': c[3]})
return sweep_list

def get_sweep_list_just_one():
start_day_offset = [1]
vax_effs = [1]
decay = [3000]
cov = [0.75]
combinations = list(itertools.product(start_day_offset, vax_effs, cov, decay))
sweep_list = []
for c in combinations:
sweep_list.append({'start_day_offset': c[0], 'efficacy': c[1], 'coverage_camp': c[2], 'decay_constant': c[3]})
return sweep_list

def get_sweep_list_from_csv():
# This is wrong. Just load rows. Code is recreating. But have to stop work for now.
import pandas as pd
df = pd.load_csv( manifest.sweep_config )
raise NotImplemented( "get_sweep_list_from_csv" )

def get_config_sweep_list():
tac = [ 13435, 15320 ]
tel = [ 5.0, 7.0 ]
tac = [ 13435 ] # , 15320 ]
tel = [ 5.0 ] # , 7.0 ]
combinations = list(itertools.product(tac, tel))
sweep_list = []
for c in combinations:
Expand All @@ -321,7 +343,8 @@ def get_config_sweep_list():
"Coverage": get_sweep_list_coverage,
"Coverage_RIA": get_sweep_list_coverage_ria,
"Coverage_Camp": get_sweep_list_coverage_camp,
"Vax_Duration": get_sweep_list_duration
"Vax_Duration": get_sweep_list_duration,
"Just_One": get_sweep_list_just_one
}

if sweep_choice not in sweep_selections.keys():
Expand Down Expand Up @@ -357,4 +380,5 @@ def get_config_sweep_list():

dtk.setup(manifest.model_dl_dir)

run( "Coverage_Camp" )
import sys
run( sys.argv[1] if len(sys.argv)>1 else "Just_One", binary_immunity=True )
6 changes: 3 additions & 3 deletions examples/future_campaign/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-i https://packages.idmod.org/api/pypi/pypi-production/simple
emodpy-typhoid==0.0.6.dev0
emodpy-typhoid==0.1.0
emodpy==1.22.0.dev3
emod-api==1.31.0.dev1
emod-typhoid==0.0.4.dev7
emod-api==1.31.0.dev3
emod-typhoid==0.0.7.dev1

0 comments on commit a82b1d8

Please sign in to comment.