-
Notifications
You must be signed in to change notification settings - Fork 4
/
DiseaseConfig.nls
81 lines (72 loc) · 3.41 KB
/
DiseaseConfig.nls
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
81
;; ===========================================================================
;; Model configuration --- TRANSITION PROBABILITIES and TIMIGS
;;
;; Change the following values to implement a different disease course
;;============================================================================
to-report average-recovery-time [agent-age]
;; Agents recover, on average, after these many days since being infected
report (ifelse-value
agent-age < 40 [8] ;; agents < 40 y.o recover in 8 days on average
agent-age < 50 [12] ;; agents between 40 and 50 recover in 12 days on avg.
agent-age < 60 [15] ;; agents between 50 and 60
[20] ;; agents above 60
)
end
;; The three parameters below interact.
;; The probability of someone dying of covid is:
;; probability-of-showing-syptoms * probability-of-worsening * probability-of-dying
;; For someone between 30 and 40 this is currently 0.5 * 0.06 * 0.03 = 0.0009 or 0.09%
to-report probability-of-showing-symptoms
;; When the incubation period ('incubation-days' in main interface) is over
;; the agent has the following probability of developing the symptoms of COVID-19.
;; If the person is showing symptoms, it'll take 7 more days to recover.
report (ifelse-value
age < 10 [0.02] ;; Children rarely show any symptoms
age < 20 [0.26] ;; young adults
age <= 40 [0.55] ;; Agents between 30 and 40
age <= 50 [0.62] ;; agents between 40 and 50
age <= 70 [0.72] ;; agents between 50 and 70
[0.82] ;; agents above 70
)
end
to-report probabilityofworsening
;; After 10 days with symptoms the agent has the following probability of
;; worsening and needing hospital care.
report (ifelse-value
age < 15 [0.02] ;;
age < 40 [0.06] ;; agents below age 40 who display symptoms have a 2% chance of ending up in hospital
age <= 50 [0.09] ;; agents between 40 and 50 ....
age < 60 [0.13] ;; agents between 50 and 60
age < 70 [0.17] ;; over 60
[0.20]
)
end
to-report probabilityofdying
;; After 10 days in the hospital the agent has the following probability of dying
report (ifelse-value
age < 15 [0.005]
age < 40 [0.03]
age < 50 [0.08]
age < 60 [0.16]
age <= 70 [0.25]
[0.50]
)
end
to assign-disease-par
set probability-of-dying probabilityofdying
set probability-of-worsening probabilityofworsening * gender-discount
set isolation-tendency random-normal average-isolation-tendency (average-isolation-tendency / 4)
if isolation-tendency > 1 [ set isolation-tendency 1 ]
if isolation-tendency < 0 [ set isolation-tendency 0 ]
set prob-symptoms probability-of-showing-symptoms
set t-asymptomatic round (random-normal (average-recovery-time age) 1)
set testing-urgency 1 + random 3 ;;time of deciding to get tested
set t-incubation max ( list 2 round (random-gamma 5.1 1)) ;;incubation duration
set t-symptomatic round (random-normal (average-recovery-time age) 1) ;;duration symptomatic
set t-severe max ( list 2 round (random-gamma 6.5 0.9)) ;;duration to hospitalization of severe 6.5 0.9
if t-severe > 14 [set t-severe 14]
set t-hospital round (random-normal (average-recovery-time age) 1) ;;time spent in the hospital
set t-infectious max (list 1 (t-incubation - random 3)) ;;time of becoming infectious
set t-stopinfecting 7 + random 4
set testing-urgency 1 + random 3
end