Skip to content

Commit

Permalink
Merge pull request #225 from Urban-Analytics/symptomatic_multi
Browse files Browse the repository at this point in the history
Symptomatic multi
  • Loading branch information
nickmalleson authored Nov 26, 2020
2 parents 9a891d8 + 30568ac commit 576f99b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion microsim/opencl/ramp/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self,
"""Create a simulator with the default parameters."""
if obesity_multipliers is None:
obesity_multipliers = [1, 1, 1, 1]
self.symptomatic_multiplier = 0.5
self.symptomatic_multiplier = 0.1
self.exposed_scale = 2.82
self.exposed_shape = 3.99
self.presymptomatic_scale = 2.45
Expand Down
7 changes: 7 additions & 0 deletions tests/opencl/test_update_flows_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ def test_correct_flow_calculation_no_lockdown():
snapshot.buffers.people_place_ids[:] = people_place_ids_test_data.flatten()
snapshot.buffers.people_statuses[:] = people_statuses_test_data
snapshot.buffers.place_activities[:] = place_activities_test_data

params = Params()
symptomatic_multiplier = 0.5
params.symptomatic_multiplier = symptomatic_multiplier
snapshot.update_params(params)

simulator = Simulator(snapshot, gpu=False)
simulator.upload_all(snapshot.buffers)
Expand All @@ -67,6 +72,7 @@ def test_correct_flow_calculation_no_lockdown():
people_flows_after = np.zeros(npeople*nslots, dtype=np.float32)
simulator.download("people_flows", people_flows_after)

# adjust symptomatic persons flows according to symptomatic multiplier
expected_people_flows_after = people_flows_test_data
expected_people_flows_after[symptomatic_person_id][0:4] = [0.85, 0.09, 0.045, 0.015]
expected_people_flows_after = expected_people_flows_after.flatten()
Expand Down Expand Up @@ -103,6 +109,7 @@ def test_correct_flow_calculation_with_lockdown():

params = Params()
params.set_lockdown_multiplier(lockdown_multipliers, 0)
params.symptomatic_multiplier = 0.5
snapshot.buffers.params[:] = params.asarray()

simulator = Simulator(snapshot, gpu=False)
Expand Down

0 comments on commit 576f99b

Please sign in to comment.