File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -147,17 +147,29 @@ def __init__(self, p: Parameters):
147
147
self .daily_growth_rate_t = get_growth_rate (self .doubling_time_t )
148
148
149
149
def run_projection (self , p ):
150
+ if p .mitigation_date is not None :
151
+ mitigation_day = (p .current_date - p .mitigation_date ).days
152
+ else :
153
+ mitigation_day = 0
154
+
155
+ total_days = self .i_day + p .n_days
156
+
157
+ if mitigation_day < - self .i_day :
158
+ mitigation_day = - self .i_day
159
+
160
+ pre_mitigation_days = self .i_day + mitigation_day
161
+ post_mitigation_days = total_days - pre_mitigation_days
162
+
150
163
self .raw_df = sim_sir_df (
151
164
self .susceptible ,
152
165
self .infected ,
153
166
p .recovered ,
154
167
self .gamma ,
155
168
- self .i_day ,
156
- self .beta ,
157
- self .i_day ,
158
- self .beta_t ,
159
- p .n_days
169
+ self .beta , pre_mitigation_days ,
170
+ self .beta_t , post_mitigation_days
160
171
)
172
+
161
173
self .dispositions_df = build_dispositions_df (self .raw_df , self .rates , p .market_share , p .current_date )
162
174
self .admits_df = build_admits_df (self .dispositions_df )
163
175
self .census_df = build_census_df (self .admits_df , self .days )
You can’t perform that action at this time.
0 commit comments