-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdump_nearest_locations.py
80 lines (66 loc) · 2.35 KB
/
dump_nearest_locations.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import argparse
import csv
import sys
from datetime import datetime, timedelta
from os import makedirs, path
from pprint import pprint
import numpy as np
import facs.base.facs as facs
import facs.base.measures as measures
from facs.readers import (
read_age_csv,
read_building_csv,
read_cases_csv,
read_disease_yml,
)
if __name__ == "__main__":
# Instantiate the parser
parser = argparse.ArgumentParser()
parser.add_argument("--location", action="store", default="brent")
parser.add_argument(
"--ci_multiplier",
action="store",
type=float,
default="0.625",
help="Multiplier set for Case Isolation which represents the ratio of out-of-house interactions for Covid patients relative to the default interaction rate. Default value comes from Imp Report 9.",
)
parser.add_argument("--disease_yml", action="store", default="disease_covid19")
parser.add_argument("--output_dir", action="store", default=".")
parser.add_argument("--data_dir", action="store", default="covid_data")
parser.add_argument(
"--dbg", action="store_true", help="Write additional outputs to help debugging"
)
args = parser.parse_args()
print(args)
house_ratio = 2
location = args.location
ci_multiplier = float(args.ci_multiplier)
disease_yml = args.disease_yml
output_dir = args.output_dir
data_dir = args.data_dir
transition_day = -1
if not path.exists(output_dir):
makedirs(output_dir)
end_time = 1100
print("Running basic simulation kernel.")
print("scenario = %s" % (location))
e = facs.Ecosystem(end_time)
e.ci_multiplier = ci_multiplier
e.ages = read_age_csv.read_age_csv("{}/age_distribution.csv".format(data_dir), location)
print("age distribution in system:", e.ages, file=sys.stderr)
e.disease = read_disease_yml.read_disease_yml(
"{}/{}.yml".format(data_dir, disease_yml)
)
building_file = "{}/{}_buildings.csv".format(data_dir, location)
read_building_csv.read_building_csv(
e,
building_file,
"{}/building_types_map.yml".format(data_dir),
house_ratio=house_ratio,
workspace=12,
office_size=1600,
household_size=2.6,
work_participation_rate=0.5,
dumpnearest=True,
)
print("Nearest locations dump complete.", file=sys.stderr)