Skip to content

Commit

Permalink
epidemic scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikunj-Gupta committed Feb 5, 2023
1 parent 7d37c05 commit 589298b
Show file tree
Hide file tree
Showing 8 changed files with 709 additions and 0 deletions.
1 change: 1 addition & 0 deletions jsons/COVID_A.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions jsons/COVID_B.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions jsons/COVID_C.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions jsons/SIRV_A.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"features": {"data_source": "GPWv4", "level": 0, "year": 2020, "region": "UP", "region_name": "UnitedProvinces", "start_date": "2021-01-01", "end_date": "2021-12-31"}, "interventions": [{"name": "Vaccination", "notes": "Each day, vaccination directly moves a fixed number of people from susceptible compartment to vaccinated compartment. The number of people vaccinated is determined by the product of 'degree' and 'max_capacity'. Hence, when the 'degree' is 100%, 'max_capacity' people are vaccinated.", "control_params": [{"id": "1", "name": "degree", "description": "0% means no vaccination at all while 100% achieves the max_capacity per day", "default_value": "1"}, {"id": "2", "name": "max_capacity", "description": "Maximum number of people vaccinated per day if 100% degree is reached", "default_value": "9200"}, {"id": "3", "name": "price_per_dose", "description": "Price per dose (or 2-dose if the vaccine requires 2 doses)", "default_value": "40"}], "effect": "def effect(cp, locales):\n\tsim.move({'compartment':'S', 'locale':locales, 'group':'*'}, {'compartment':'V1','locale':locales, 'group':'*'}, cp['degree']*cp['max_capacity'])", "cost": "def cost(cp, locales):\n\tdoses = cp['degree']*cp['max_capacity']\n\tsim.add({'locale':locales}, doses*cp['price_per_dose'])", "id": "1"}, {"name": "Masks", "notes": "Mask reduces the transmission rate in all facilities except Household (since people do not where mask in household). Mask is modeled by two control parameters 'compliance' and 'max_transmission_reduction'. At 100% 'compliance', there will be a 'max_transmission_reduction' to the transmission rate in all facilities except Household.", "control_params": [{"id": "1", "name": "compliance", "description": "Percentage of people wearing mask", "default_value": "0.3"}, {"id": "2", "name": "cost_per_day", "description": "Cost per mask", "default_value": "0.05"}, {"id": "3", "name": "max_transmission_reduction", "description": "Maximum percentage of reduction for transmission rate when there is 100% compliance", "default_value": "0.5"}], "effect": "def effect(cp, locales):\n\tsim.apply({'parameter':'beta', 'facility':'*', 'locale':locales}, 1-cp['compliance']*cp['max_transmission_reduction'])", "cost": "def cost(cp, locales):\n\tcompliance_count = sim.select({'compartment':'*', 'locale':locales})['Value'].sum() * cp['compliance']\n\tsim.add({'locale':locales}, compliance_count*cp['cost_per_day'])", "id": "2"}], "costs": [{"name": "Infection_Cost", "notes": "At each day, there will be a cost incurred for each infectious person ", "control_params": [{"id": "1", "name": "cost_per_day", "description": "Cost of infection per person per day", "default_value": "173"}], "func": "def cost(cp):\n\tinfectious_count = sim.select({'compartment':'{\"tag\":\"infectious\"}'})['Value'].sum()\n\tsim.add({}, infectious_count*cp['cost_per_day'])", "id": "2"}], "locales": [{"population": 2224526, "area": 99324, "name": "UnitedProvinces", "id": "UP", "parent_id": ""}], "model": {"name": "Two-dose vaccine SIR", "compartments": [{"id": 1, "name": "S", "desc": "Susceptible", "equation": "-(beta * I * S / N) + nu * R - (v1 * S)", "tags": ["susceptible"]}, {"id": 2, "name": "I", "desc": "Infected", "equation": "(beta * I * S / N) + (p1 * beta * I * V1 / N)\n - (gamma * I)", "tags": ["infectious"]}, {"id": 3, "name": "R", "desc": "Recovered", "equation": "gamma * I - (nu * R)", "tags": []}, {"id": 4, "name": "V1", "desc": "One-dose Vaccinated", "equation": "v1 * S - v2 * V1 - (p1 * beta * I * V1 / N)", "tags": ["susceptible"]}, {"id": 5, "name": "V2", "desc": "Two-dose Vaccinated", "equation": "v2 * V1", "tags": ["vaccinated"]}], "parameters": [{"id": 1, "name": "beta", "desc": "Transmission rate", "default_value": "0.2", "tags": ["transmission"]}, {"id": 2, "name": "gamma", "desc": "Recovery rate", "default_value": "0.05", "tags": []}, {"id": 3, "name": "nu", "desc": "Immunity-loss rate", "default_value": "0.01", "tags": []}, {"id": 4, "name": "v1", "desc": "One-dose vaccination rate", "default_value": "0", "tags": []}, {"id": 5, "name": "v2", "desc": "Two-dose vaccination rate", "default_value": "0.0476", "tags": []}, {"id": 6, "name": "p1", "desc": "Reduction from transmission after first dose", "default_value": "0.5", "tags": []}]}, "initial_info": {"name": "Test5", "notes": "", "initializers": [{"id": 1, "locale_regex": "UnitedProvinces.*", "group": "*", "compartment": "I", "value": "100"}]}, "groups": [], "group_specifications": [], "groups_locales_parameters": [], "facilities": [], "facilities_interactions": [], "facilities_timespent": [], "interaction_specifications": [], "schedules": [{"id": "1", "name": "Vaccination", "notes": "describe schedule for Vaccination...", "detail": [{"id": 1, "start_date": "2021-01-01", "end_date": "2021-06-30", "control_params": [{"name": "degree", "value": "1"}, {"name": "max_capacity", "value": "9200"}, {"name": "price_per_dose", "value": "40"}], "locales": "UnitedProvinces.*", "has_trigger": false, "condition": "def isActive():\n\t# code here, this function must return a boolean value!\n\treturn True\n\t", "repeat_config": {"repeat_type": "none", "end_type": "never", "end_date": "2021-12-31", "end_times": 0}, "repetition_of": null}]}, {"id": "2", "name": "Masks", "notes": "describe schedule for Masks...", "detail": [{"id": 1, "start_date": "2021-01-01", "end_date": "2021-06-30", "control_params": [{"name": "compliance", "value": "1"}, {"name": "cost_per_day", "value": "0.05"}, {"name": "max_transmission_reduction", "value": "0.5"}], "locales": "UnitedProvinces.*", "has_trigger": false, "condition": "def isActive():\n\t# code here, this function must return a boolean value!\n\treturn True\n\t", "repeat_config": {"repeat_type": "none", "end_type": "never", "end_date": "2021-12-31", "end_times": 0}, "repetition_of": null}, {"id": 2, "start_date": "2021-07-01", "end_date": "2021-12-31", "control_params": [{"name": "compliance", "value": "0.3"}, {"name": "cost_per_day", "value": "0.05"}, {"name": "max_transmission_reduction", "value": "0.5"}], "locales": "UnitedProvinces.*", "has_trigger": false, "condition": "def isActive():\n\t# code here, this function must return a boolean value!\n\treturn True\n\t", "repeat_config": {"repeat_type": "none", "end_type": "never", "end_date": "2021-12-31", "end_times": 0}, "repetition_of": null}]}], "references": [], "mobility": [], "mobility_specifications": [], "border": {"data": [], "specifications": [{"id": 1, "src_locale": "UnitedProvinces", "dst_locale": "UnitedProvinces", "group": "*", "value": 0, "impedance": 70, "mobility_source": "GPWv4"}]}, "airport": {"data": [], "specifications": []}, "facility": {"data": [], "specifications": []}, "optimize": {"configs": {"max_cost": 1000000000000}, "interventions": [{"name": "Vaccination", "control_params": [{"name": "degree", "min_value": 0, "max_value": 1}, {"name": "max_capacity", "min_value": 9200.0, "max_value": 9200.0}, {"name": "price_per_dose", "min_value": 40.0, "max_value": 40.0}]}, {"name": "Masks", "control_params": [{"name": "compliance", "min_value": 0, "max_value": 1}, {"name": "cost_per_day", "min_value": 0.05, "max_value": 0.05}, {"name": "max_transmission_reduction", "min_value": 0.5, "max_value": 0.5}]}]}}
1 change: 1 addition & 0 deletions jsons/SIRV_B.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"features":{"data_source":"GPWv4","level":0,"year":2020,"region":"UP","region_name":"UnitedProvinces","start_date":"2021-01-01","end_date":"2021-12-31"},"interventions":[{"name":"Vaccination","notes":"Each day, vaccination directly moves a fixed number of people from susceptible compartment to vaccinated compartment. The number of people vaccinated is determined by the product of 'degree' and 'max_capacity'. Hence, when the 'degree' is 100%, 'max_capacity' people are vaccinated.","control_params":[{"id":"1","name":"degree","description":"0% means no vaccination at all while 100% achieves the max_capacity per day","default_value":"1"},{"id":"2","name":"max_capacity","description":"Maximum number of people vaccinated per day if 100% degree is reached","default_value":"9200"},{"id":"3","name":"price_per_dose","description":"Price per dose (or 2-dose if the vaccine requires 2 doses)","default_value":"40"}],"effect":"def effect(cp, locales):\n\tsim.move({'compartment':'S', 'locale':locales, 'group':'*'}, {'compartment':'V1','locale':locales, 'group':'*'}, cp['degree']*cp['max_capacity'])","cost":"def cost(cp, locales):\n\tdoses = cp['degree']*cp['max_capacity']\n\tsim.add({'locale':locales}, doses*cp['price_per_dose'])","id":"1"},{"name":"Masks","notes":"Mask reduces the transmission rate in all facilities except Household (since people do not where mask in household). Mask is modeled by two control parameters 'compliance' and 'max_transmission_reduction'. At 100% 'compliance', there will be a 'max_transmission_reduction' to the transmission rate in all facilities except Household.","control_params":[{"id":"1","name":"compliance","description":"Percentage of people wearing mask","default_value":"0.3"},{"id":"2","name":"cost_per_day","description":"Cost per mask","default_value":"0.05"},{"id":"3","name":"max_transmission_reduction","description":"Maximum percentage of reduction for transmission rate when there is 100% compliance","default_value":"0.5"}],"effect":"def effect(cp, locales):\n\tsim.apply({'parameter':'beta', 'facility':'*', 'locale':locales}, 1-cp['compliance']*cp['max_transmission_reduction'])","cost":"def cost(cp, locales):\n\tcompliance_count = sim.select({'compartment':'*', 'locale':locales})['Value'].sum() * cp['compliance']\n\tsim.add({'locale':locales}, compliance_count*cp['cost_per_day'])","id":"2"},{"id":"3","name":"School closure","notes":"Close school","control_params":[{"id":"1","name":"percentage","description":"The percentage of students being remote","default_value":"0"},{"id":"2","name":"cost_per_day","description":"Economic cost of affecting one student per day","default_value":"1.8"}],"effect":"def effect(cp, locales):\n sim.apply({\"facility\": \"School\", \"locale\":locales, \"group-from\":\"*\", \"group-to\":\"*\"}, 1-cp['percentage'])","cost":"def cost(cp, locales):\n affectedCount = sim.select({'compartment':'*', 'locale':locales, 'group':\"Children\"})['Value'].sum() * cp['percentage']\n sim.add({'locale':locales}, affectedCount*cp['cost_per_day'])"},{"id":"4","name":"Workplace closure","notes":"Close workplace","control_params":[{"id":"1","name":"percentage","description":"describe parameter 1 here...","default_value":"0"},{"id":"2","name":"cost_per_day","description":"describe parameter 2 here...","default_value":"1.8"}],"effect":"def effect(cp, locales):\n sim.apply({\"facility\": \"Workplace\", \"locale\":locales, \"group-from\":\"*\", \"group-to\":\"*\"}, 1-cp['percentage'])\n","cost":"def cost(cp, locales):\n affectedCount = sim.select({'compartment':'*', 'locale':locales, 'group':\"Adults\"})['Value'].sum() * cp['percentage']\n sim.add({'locale':locales}, affectedCount*cp['cost_per_day'])\n"}],"costs":[{"name":"Infection_Cost","notes":"At each day, there will be a cost incurred for each infectious person ","control_params":[{"id":"1","name":"cost_per_day","description":"Cost of infection per person per day","default_value":"173"}],"func":"def cost(cp):\n\tinfectious_count = sim.select({'compartment':'{\"tag\":\"infectious\"}'})['Value'].sum()\n\tsim.add({}, infectious_count*cp['cost_per_day'])","id":"2"}],"locales":[{"population":2224526,"area":99324,"name":"UnitedProvinces","id":"UP","parent_id":""}],"model":{"name":"Two-dose vaccine SIR","compartments":[{"id":1,"name":"S","desc":"Susceptible","equation":"-(beta * I * S / N) + nu * R - (v1 * S)","tags":["susceptible"]},{"id":2,"name":"I","desc":"Infected","equation":"(beta * I * S / N) + (p1 * beta * I * V1 / N)\n - (gamma * I)","tags":["infectious"]},{"id":3,"name":"R","desc":"Recovered","equation":"gamma * I - (nu * R)","tags":[]},{"id":4,"name":"V1","desc":"One-dose Vaccinated","equation":"v1 * S - v2 * V1 - (p1 * beta * I * V1 / N)","tags":["susceptible"]},{"id":5,"name":"V2","desc":"Two-dose Vaccinated","equation":"v2 * V1","tags":["vaccinated"]}],"parameters":[{"id":1,"name":"beta","desc":"Transmission rate","default_value":"0.2","tags":["transmission"]},{"id":2,"name":"gamma","desc":"Recovery rate","default_value":"0.05","tags":[]},{"id":3,"name":"nu","desc":"Immunity-loss rate","default_value":"0.01","tags":[]},{"id":4,"name":"v1","desc":"One-dose vaccination rate","default_value":"0","tags":[]},{"id":5,"name":"v2","desc":"Two-dose vaccination rate","default_value":"0.0476","tags":[]},{"id":6,"name":"p1","desc":"Reduction from transmission after first dose","default_value":"0.5","tags":[]}]},"initial_info":{"name":"Test11","notes":"","initializers":[{"id":1,"locale_regex":"UnitedProvinces.*","group":"*","compartment":"I","value":"100"}]},"groups":[{"name":"Children","description":"","locales":[{"name":"UnitedProvinces","id":"UP","population":0.251}],"properties":{"type":"GPWv4","gender":["m","f"],"age":[0,19]}},{"name":"Adults","description":"","locales":[{"name":"UnitedProvinces","id":"UP","population":0.735}],"properties":{"type":"GPWv4","gender":["m","f"],"age":[20,59]}},{"name":"Seniors","description":"","locales":[{"name":"UnitedProvinces","id":"UP","population":0.013}],"properties":{"type":"GPWv4","gender":["m","f"],"age":[60,84]}}],"group_specifications":[],"groups_locales_parameters":[{"id":0,"param":"beta","locale":"UnitedProvinces","group":"Children","value":"0.2"},{"id":1,"param":"gamma","locale":"UnitedProvinces","group":"Children","value":"0.05"},{"id":2,"param":"nu","locale":"UnitedProvinces","group":"Children","value":"0.01"},{"id":3,"param":"v1","locale":"UnitedProvinces","group":"Children","value":"0"},{"id":4,"param":"v2","locale":"UnitedProvinces","group":"Children","value":"0.0476"},{"id":5,"param":"p1","locale":"UnitedProvinces","group":"Children","value":"0.5"},{"id":6,"param":"beta","locale":"UnitedProvinces","group":"Adults","value":"0.2"},{"id":7,"param":"gamma","locale":"UnitedProvinces","group":"Adults","value":"0.05"},{"id":8,"param":"nu","locale":"UnitedProvinces","group":"Adults","value":"0.01"},{"id":9,"param":"v1","locale":"UnitedProvinces","group":"Adults","value":"0"},{"id":10,"param":"v2","locale":"UnitedProvinces","group":"Adults","value":"0.0476"},{"id":11,"param":"p1","locale":"UnitedProvinces","group":"Adults","value":"0.5"},{"id":12,"param":"beta","locale":"UnitedProvinces","group":"Seniors","value":"0.2"},{"id":13,"param":"gamma","locale":"UnitedProvinces","group":"Seniors","value":"0.05"},{"id":14,"param":"nu","locale":"UnitedProvinces","group":"Seniors","value":"0.01"},{"id":15,"param":"v1","locale":"UnitedProvinces","group":"Seniors","value":"0"},{"id":16,"param":"v2","locale":"UnitedProvinces","group":"Seniors","value":"0.0476"},{"id":17,"param":"p1","locale":"UnitedProvinces","group":"Seniors","value":"0.5"}],"facilities":[{"id":1,"name":"Household","description":"The household facility represents the pairwise connections between household members. Unlike schools and workplaces, everyone must be assigned to a household."},{"id":2,"name":"School","description":"The school facility represents all of the pairwise connections between people in schools, including both students and teachers. The current methods in SynthPops treat student and worker status as mutually exclusive."},{"id":3,"name":"Workplace","description":"The workplace facility represents all of the pairwise connections between people in workplaces, except for teachers working in schools. After some workers are assigned to the school contact layer as teachers, all remaining workers are assigned to workplaces. Workplaces are special in that there is little/no age structure so workers of all ages may be present in every workplace."},{"id":4,"name":"Community","description":"The community facility reflects the nature of contacts in shared public spaces like parks and recreational spaces, shopping centres, community centres, and public transportation. All links between individuals are considered undirected to reflect the ability of either individual in the pair to infect each other."}],"facilities_interactions":[{"locales":"UnitedProvinces.*","facilities":[[[0.37,0.53,0.1],[0.32,0.6,0.07],[0.27,0.36,0.37]],[[0.92,0.08,0],[0.67,0.33,0],[0.75,0.25,0]],[[0,0.89,0.11],[0.03,0.92,0.05],[0.04,0.94,0.02]],[[0.54,0.4,0.06],[0.14,0.73,0.13],[0.1,0.57,0.34]]]}],"facilities_timespent":[{"locales":"UnitedProvinces.*","matrix":[[0.4,0.4,0.54],[0.31,0.08,0.01],[0.08,0.32,0.18],[0.2,0.2,0.27]]}],"interaction_specifications":[],"schedules":[{"id":"1","name":"Vaccination","notes":"describe schedule for Vaccination...","detail":[{"id":1,"start_date":"2021-01-01","end_date":"2021-06-30","control_params":[{"name":"degree","value":"1"},{"name":"max_capacity","value":"9200"},{"name":"price_per_dose","value":"40"}],"locales":"UnitedProvinces.*","has_trigger":false,"condition":"def isActive():\n\t# code here, this function must return a boolean value!\n\treturn True\n\t","repeat_config":{"repeat_type":"none","end_type":"never","end_date":"2021-12-31","end_times":0},"repetition_of":null}]},{"id":"2","name":"Masks","notes":"describe schedule for Masks...","detail":[{"id":1,"start_date":"2021-01-01","end_date":"2021-06-30","control_params":[{"name":"compliance","value":"1"},{"name":"cost_per_day","value":"0.05"},{"name":"max_transmission_reduction","value":"0.5"}],"locales":"UnitedProvinces.*","has_trigger":false,"condition":"def isActive():\n\t# code here, this function must return a boolean value!\n\treturn True\n\t","repeat_config":{"repeat_type":"none","end_type":"never","end_date":"2021-12-31","end_times":0},"repetition_of":null},{"id":2,"start_date":"2021-07-01","end_date":"2021-12-31","control_params":[{"name":"compliance","value":"0.3"},{"name":"cost_per_day","value":"0.05"},{"name":"max_transmission_reduction","value":"0.5"}],"locales":"UnitedProvinces.*","has_trigger":false,"condition":"def isActive():\n\t# code here, this function must return a boolean value!\n\treturn True\n\t","repeat_config":{"repeat_type":"none","end_type":"never","end_date":"2021-12-31","end_times":0},"repetition_of":null}]},{"id":"3","name":"School closure","notes":"describe schedule for School closure...","detail":[{"id":1,"start_date":"2021-01-01","end_date":"2021-12-31","control_params":[{"name":"percentage","value":"0.2"},{"name":"cost_per_day","value":"1.8"}],"locales":"UnitedProvinces.*","has_trigger":false,"condition":"def isActive():\n\t# code here, this function must return a boolean value!\n\treturn True\n\t","repeat_config":{"repeat_type":"none","end_type":"never","end_date":"2021-12-31","end_times":0},"repetition_of":null}]},{"id":"4","name":"Workplace closure","notes":"describe schedule for Workplace closure...","detail":[{"id":1,"start_date":"2021-01-01","end_date":"2021-12-31","control_params":[{"name":"percentage","value":"0.2"},{"name":"cost_per_day","value":"1.8"}],"locales":"UnitedProvinces.*","has_trigger":false,"condition":"def isActive():\n\t# code here, this function must return a boolean value!\n\treturn True\n\t","repeat_config":{"repeat_type":"none","end_type":"never","end_date":"2021-12-31","end_times":0},"repetition_of":null}]}],"references":[],"mobility":[],"mobility_specifications":[],"border":{"data":[],"specifications":[{"id":1,"src_locale":"UnitedProvinces","dst_locale":"UnitedProvinces","group":"*","value":0,"impedance":70,"mobility_source":"GPWv4"}]},"airport":{"data":[],"specifications":[]},"facility":{"data":[],"specifications":[]},"optimize":{"configs":{"max_cost":1000000000000},"interventions":[{"name":"Vaccination","control_params":[{"name":"degree","min_value":0,"max_value":1},{"name":"max_capacity","min_value":9200,"max_value":9200},{"name":"price_per_dose","min_value":40,"max_value":40}]},{"name":"Masks","control_params":[{"name":"compliance","min_value":0,"max_value":1},{"name":"cost_per_day","min_value":0.05,"max_value":0.05},{"name":"max_transmission_reduction","min_value":0.5,"max_value":0.5}]},{"name":"School closure","control_params":[{"name":"percentage","min_value":0,"max_value":1},{"name":"cost_per_day","min_value":1.8,"max_value":1.8}]},{"name":"Workplace closure","control_params":[{"name":"percentage","min_value":0,"max_value":1},{"name":"cost_per_day","min_value":1.8,"max_value":1.8}]}]}}
Loading

0 comments on commit 589298b

Please sign in to comment.