@@ -108,44 +108,10 @@ void set_local_parameters(mio::abm::Model& world)
108108 0.0087 0.0394 0.1417 0.3834 0.7064 0.0447
109109 0.0292 0.0648 0.1248 0.4179 0.3497 0.1544
110110 */
111- mio::CustomIndexArray<ScalarType, mio::AgeGroup, mio::AgeGroup> contacts_home (
112- {mio::AgeGroup (n_age_groups), mio::AgeGroup (n_age_groups)}, 0 .);
113- contacts_home[{age_group_0_to_4, age_group_0_to_4}] = 0.4413 ;
114- contacts_home[{age_group_0_to_4, age_group_5_to_14}] = 0.0504 ;
115- contacts_home[{age_group_0_to_4, age_group_15_to_34}] = 1.2383 ;
116- contacts_home[{age_group_0_to_4, age_group_35_to_59}] = 0.8033 ;
117- contacts_home[{age_group_0_to_4, age_group_60_to_79}] = 0.0494 ;
118- contacts_home[{age_group_0_to_4, age_group_80_plus}] = 0.0017 ;
119- contacts_home[{age_group_5_to_14, age_group_0_to_4}] = 0.0485 ;
120- contacts_home[{age_group_5_to_14, age_group_5_to_14}] = 0.7616 ;
121- contacts_home[{age_group_5_to_14, age_group_15_to_34}] = 0.6532 ;
122- contacts_home[{age_group_5_to_14, age_group_35_to_59}] = 1.1614 ;
123- contacts_home[{age_group_5_to_14, age_group_60_to_79}] = 0.0256 ;
124- contacts_home[{age_group_5_to_14, age_group_80_plus}] = 0.0013 ;
125- contacts_home[{age_group_15_to_34, age_group_0_to_4}] = 0.1800 ;
126- contacts_home[{age_group_15_to_34, age_group_5_to_14}] = 0.1795 ;
127- contacts_home[{age_group_15_to_34, age_group_15_to_34}] = 0.8806 ;
128- contacts_home[{age_group_15_to_34, age_group_35_to_59}] = 0.6413 ;
129- contacts_home[{age_group_15_to_34, age_group_60_to_79}] = 0.0429 ;
130- contacts_home[{age_group_15_to_34, age_group_80_plus}] = 0.0032 ;
131- contacts_home[{age_group_35_to_59, age_group_0_to_4}] = 0.0495 ;
132- contacts_home[{age_group_35_to_59, age_group_5_to_14}] = 0.2639 ;
133- contacts_home[{age_group_35_to_59, age_group_15_to_34}] = 0.5189 ;
134- contacts_home[{age_group_35_to_59, age_group_35_to_59}] = 0.8277 ;
135- contacts_home[{age_group_35_to_59, age_group_60_to_79}] = 0.0679 ;
136- contacts_home[{age_group_35_to_59, age_group_80_plus}] = 0.0014 ;
137- contacts_home[{age_group_60_to_79, age_group_0_to_4}] = 0.0087 ;
138- contacts_home[{age_group_60_to_79, age_group_5_to_14}] = 0.0394 ;
139- contacts_home[{age_group_60_to_79, age_group_15_to_34}] = 0.1417 ;
140- contacts_home[{age_group_60_to_79, age_group_35_to_59}] = 0.3834 ;
141- contacts_home[{age_group_60_to_79, age_group_60_to_79}] = 0.7064 ;
142- contacts_home[{age_group_60_to_79, age_group_80_plus}] = 0.0447 ;
143- contacts_home[{age_group_80_plus, age_group_0_to_4}] = 0.0292 ;
144- contacts_home[{age_group_80_plus, age_group_5_to_14}] = 0.0648 ;
145- contacts_home[{age_group_80_plus, age_group_15_to_34}] = 0.1248 ;
146- contacts_home[{age_group_80_plus, age_group_35_to_59}] = 0.4179 ;
147- contacts_home[{age_group_80_plus, age_group_60_to_79}] = 0.3497 ;
148- contacts_home[{age_group_80_plus, age_group_80_plus}] = 0.1544 ;
111+ Eigen::MatrixXd contacts_home (n_age_groups, n_age_groups);
112+ contacts_home << 0.4413 , 0.0504 , 1.2383 , 0.8033 , 0.0494 , 0.0017 , 0.0485 , 0.7616 , 0.6532 , 1.1614 , 0.0256 , 0.0013 ,
113+ 0.1800 , 0.1795 , 0.8806 , 0.6413 , 0.0429 , 0.0032 , 0.0495 , 0.2639 , 0.5189 , 0.8277 , 0.0679 , 0.0014 , 0.0087 , 0.0394 ,
114+ 0.1417 , 0.3834 , 0.7064 , 0.0447 , 0.0292 , 0.0648 , 0.1248 , 0.4179 , 0.3497 , 0.1544 ;
149115
150116 /* baseline_school
151117 1.1165 0.2741 0.2235 0.1028 0.0007 0.0000
@@ -155,44 +121,10 @@ void set_local_parameters(mio::abm::Model& world)
155121 0.0004 0.0370 0.0115 0.0014 0.0039 0.0000
156122 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
157123 */
158- mio::CustomIndexArray<ScalarType, mio::AgeGroup, mio::AgeGroup> contacts_school (
159- {mio::AgeGroup (n_age_groups), mio::AgeGroup (n_age_groups)}, 0 .);
160- contacts_school[{age_group_0_to_4, age_group_0_to_4}] = 1.1165 ;
161- contacts_school[{age_group_0_to_4, age_group_5_to_14}] = 0.2741 ;
162- contacts_school[{age_group_0_to_4, age_group_15_to_34}] = 0.2235 ;
163- contacts_school[{age_group_0_to_4, age_group_35_to_59}] = 0.1028 ;
164- contacts_school[{age_group_0_to_4, age_group_60_to_79}] = 0.0007 ;
165- contacts_school[{age_group_0_to_4, age_group_80_plus}] = 0.0000 ;
166- contacts_school[{age_group_5_to_14, age_group_0_to_4}] = 0.1627 ;
167- contacts_school[{age_group_5_to_14, age_group_5_to_14}] = 1.9412 ;
168- contacts_school[{age_group_5_to_14, age_group_15_to_34}] = 0.2431 ;
169- contacts_school[{age_group_5_to_14, age_group_35_to_59}] = 0.1780 ;
170- contacts_school[{age_group_5_to_14, age_group_60_to_79}] = 0.0130 ;
171- contacts_school[{age_group_5_to_14, age_group_80_plus}] = 0.0000 ;
172- contacts_school[{age_group_15_to_34, age_group_0_to_4}] = 0.0148 ;
173- contacts_school[{age_group_15_to_34, age_group_5_to_14}] = 0.1646 ;
174- contacts_school[{age_group_15_to_34, age_group_15_to_34}] = 1.1266 ;
175- contacts_school[{age_group_15_to_34, age_group_35_to_59}] = 0.0923 ;
176- contacts_school[{age_group_15_to_34, age_group_60_to_79}] = 0.0074 ;
177- contacts_school[{age_group_15_to_34, age_group_80_plus}] = 0.0000 ;
178- contacts_school[{age_group_35_to_59, age_group_0_to_4}] = 0.0367 ;
179- contacts_school[{age_group_35_to_59, age_group_5_to_14}] = 0.1843 ;
180- contacts_school[{age_group_35_to_59, age_group_15_to_34}] = 0.3265 ;
181- contacts_school[{age_group_35_to_59, age_group_35_to_59}] = 0.0502 ;
182- contacts_school[{age_group_35_to_59, age_group_60_to_79}] = 0.0021 ;
183- contacts_school[{age_group_35_to_59, age_group_80_plus}] = 0.0005 ;
184- contacts_school[{age_group_60_to_79, age_group_0_to_4}] = 0.0004 ;
185- contacts_school[{age_group_60_to_79, age_group_5_to_14}] = 0.0370 ;
186- contacts_school[{age_group_60_to_79, age_group_15_to_34}] = 0.0115 ;
187- contacts_school[{age_group_60_to_79, age_group_35_to_59}] = 0.0014 ;
188- contacts_school[{age_group_60_to_79, age_group_60_to_79}] = 0.0039 ;
189- contacts_school[{age_group_60_to_79, age_group_80_plus}] = 0.0000 ;
190- contacts_school[{age_group_80_plus, age_group_0_to_4}] = 0.0000 ;
191- contacts_school[{age_group_80_plus, age_group_5_to_14}] = 0.0000 ;
192- contacts_school[{age_group_80_plus, age_group_15_to_34}] = 0.0000 ;
193- contacts_school[{age_group_80_plus, age_group_35_to_59}] = 0.0000 ;
194- contacts_school[{age_group_80_plus, age_group_60_to_79}] = 0.0000 ;
195- contacts_school[{age_group_80_plus, age_group_80_plus}] = 0.0000 ;
124+ Eigen::MatrixXd contacts_school (n_age_groups, n_age_groups);
125+ contacts_school << 1.1165 , 0.2741 , 0.2235 , 0.1028 , 0.0007 , 0.0000 , 0.1627 , 1.9412 , 0.2431 , 0.1780 , 0.0130 , 0.0000 ,
126+ 0.0148 , 0.1646 , 1.1266 , 0.0923 , 0.0074 , 0.0000 , 0.0367 , 0.1843 , 0.3265 , 0.0502 , 0.0021 , 0.0005 , 0.0004 , 0.0370 ,
127+ 0.0115 , 0.0014 , 0.0039 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 ;
196128
197129 /* baseline_work
198130 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
@@ -202,44 +134,10 @@ void set_local_parameters(mio::abm::Model& world)
202134 0.0000 0.0002 0.0194 0.0325 0.0003 0.0000
203135 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
204136 */
205- mio::CustomIndexArray<ScalarType, mio::AgeGroup, mio::AgeGroup> contacts_work (
206- {mio::AgeGroup (n_age_groups), mio::AgeGroup (n_age_groups)}, 0 .);
207- contacts_work[{age_group_0_to_4, age_group_0_to_4}] = 0.0000 ;
208- contacts_work[{age_group_0_to_4, age_group_5_to_14}] = 0.0000 ;
209- contacts_work[{age_group_0_to_4, age_group_15_to_34}] = 0.0000 ;
210- contacts_work[{age_group_0_to_4, age_group_35_to_59}] = 0.0000 ;
211- contacts_work[{age_group_0_to_4, age_group_60_to_79}] = 0.0000 ;
212- contacts_work[{age_group_0_to_4, age_group_80_plus}] = 0.0000 ;
213- contacts_work[{age_group_5_to_14, age_group_0_to_4}] = 0.0000 ;
214- contacts_work[{age_group_5_to_14, age_group_5_to_14}] = 0.0000 ;
215- contacts_work[{age_group_5_to_14, age_group_15_to_34}] = 0.0000 ;
216- contacts_work[{age_group_5_to_14, age_group_35_to_59}] = 0.0000 ;
217- contacts_work[{age_group_5_to_14, age_group_60_to_79}] = 0.0000 ;
218- contacts_work[{age_group_5_to_14, age_group_80_plus}] = 0.0000 ;
219- contacts_work[{age_group_15_to_34, age_group_0_to_4}] = 0.0000 ;
220- contacts_work[{age_group_15_to_34, age_group_5_to_14}] = 0.0127 ;
221- contacts_work[{age_group_15_to_34, age_group_15_to_34}] = 1.7570 ;
222- contacts_work[{age_group_15_to_34, age_group_35_to_59}] = 1.6050 ;
223- contacts_work[{age_group_15_to_34, age_group_60_to_79}] = 0.0133 ;
224- contacts_work[{age_group_15_to_34, age_group_80_plus}] = 0.0000 ;
225- contacts_work[{age_group_35_to_59, age_group_0_to_4}] = 0.0000 ;
226- contacts_work[{age_group_35_to_59, age_group_5_to_14}] = 0.0020 ;
227- contacts_work[{age_group_35_to_59, age_group_15_to_34}] = 1.0311 ;
228- contacts_work[{age_group_35_to_59, age_group_35_to_59}] = 2.3166 ;
229- contacts_work[{age_group_35_to_59, age_group_60_to_79}] = 0.0098 ;
230- contacts_work[{age_group_35_to_59, age_group_80_plus}] = 0.0000 ;
231- contacts_work[{age_group_60_to_79, age_group_0_to_4}] = 0.0000 ;
232- contacts_work[{age_group_60_to_79, age_group_5_to_14}] = 0.0002 ;
233- contacts_work[{age_group_60_to_79, age_group_15_to_34}] = 0.0194 ;
234- contacts_work[{age_group_60_to_79, age_group_35_to_59}] = 0.0325 ;
235- contacts_work[{age_group_60_to_79, age_group_60_to_79}] = 0.0003 ;
236- contacts_work[{age_group_60_to_79, age_group_80_plus}] = 0.0000 ;
237- contacts_work[{age_group_80_plus, age_group_0_to_4}] = 0.0000 ;
238- contacts_work[{age_group_80_plus, age_group_5_to_14}] = 0.0000 ;
239- contacts_work[{age_group_80_plus, age_group_15_to_34}] = 0.0000 ;
240- contacts_work[{age_group_80_plus, age_group_35_to_59}] = 0.0000 ;
241- contacts_work[{age_group_80_plus, age_group_60_to_79}] = 0.0000 ;
242- contacts_work[{age_group_80_plus, age_group_80_plus}] = 0.0000 ;
137+ Eigen::MatrixXd contacts_work (n_age_groups, n_age_groups);
138+ contacts_work << 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 ,
139+ 0.0000 , 0.0127 , 1.7570 , 1.6050 , 0.0133 , 0.0000 , 0.0000 , 0.0020 , 1.0311 , 2.3166 , 0.0098 , 0.0000 , 0.0000 , 0.0002 ,
140+ 0.0194 , 0.0325 , 0.0003 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 , 0.0000 ;
243141
244142 /* baseline_other
245143 0.5170 0.3997 0.7957 0.9958 0.3239 0.0428
@@ -249,78 +147,46 @@ void set_local_parameters(mio::abm::Model& world)
249147 0.0371 0.0393 0.4171 0.9666 0.7495 0.0257
250148 0.0791 0.0800 0.3480 0.5588 0.2769 0.0180
251149 */
252- mio::CustomIndexArray<ScalarType, mio::AgeGroup, mio::AgeGroup> contacts_other (
253- {mio::AgeGroup (n_age_groups), mio::AgeGroup (n_age_groups)}, 0 .);
254- contacts_other[{age_group_0_to_4, age_group_0_to_4}] = 0.5170 ;
255- contacts_other[{age_group_0_to_4, age_group_5_to_14}] = 0.3997 ;
256- contacts_other[{age_group_0_to_4, age_group_15_to_34}] = 0.7957 ;
257- contacts_other[{age_group_0_to_4, age_group_35_to_59}] = 0.9958 ;
258- contacts_other[{age_group_0_to_4, age_group_60_to_79}] = 0.3239 ;
259- contacts_other[{age_group_0_to_4, age_group_80_plus}] = 0.0428 ;
260- contacts_other[{age_group_5_to_14, age_group_0_to_4}] = 0.0632 ;
261- contacts_other[{age_group_5_to_14, age_group_5_to_14}] = 0.9121 ;
262- contacts_other[{age_group_5_to_14, age_group_15_to_34}] = 0.3254 ;
263- contacts_other[{age_group_5_to_14, age_group_35_to_59}] = 0.4731 ;
264- contacts_other[{age_group_5_to_14, age_group_60_to_79}] = 0.2355 ;
265- contacts_other[{age_group_5_to_14, age_group_80_plus}] = 0.0148 ;
266- contacts_other[{age_group_15_to_34, age_group_0_to_4}] = 0.0336 ;
267- contacts_other[{age_group_15_to_34, age_group_5_to_14}] = 0.1604 ;
268- contacts_other[{age_group_15_to_34, age_group_15_to_34}] = 1.7529 ;
269- contacts_other[{age_group_15_to_34, age_group_35_to_59}] = 0.8622 ;
270- contacts_other[{age_group_15_to_34, age_group_60_to_79}] = 0.1440 ;
271- contacts_other[{age_group_15_to_34, age_group_80_plus}] = 0.0077 ;
272- contacts_other[{age_group_35_to_59, age_group_0_to_4}] = 0.0204 ;
273- contacts_other[{age_group_35_to_59, age_group_5_to_14}] = 0.1444 ;
274- contacts_other[{age_group_35_to_59, age_group_15_to_34}] = 0.5738 ;
275- contacts_other[{age_group_35_to_59, age_group_35_to_59}] = 1.2127 ;
276- contacts_other[{age_group_35_to_59, age_group_60_to_79}] = 0.3433 ;
277- contacts_other[{age_group_35_to_59, age_group_80_plus}] = 0.0178 ;
278- contacts_other[{age_group_60_to_79, age_group_0_to_4}] = 0.0371 ;
279- contacts_other[{age_group_60_to_79, age_group_5_to_14}] = 0.0393 ;
280- contacts_other[{age_group_60_to_79, age_group_15_to_34}] = 0.4171 ;
281- contacts_other[{age_group_60_to_79, age_group_35_to_59}] = 0.9666 ;
282- contacts_other[{age_group_60_to_79, age_group_60_to_79}] = 0.7495 ;
283- contacts_other[{age_group_60_to_79, age_group_80_plus}] = 0.0257 ;
284- contacts_other[{age_group_80_plus, age_group_0_to_4}] = 0.0791 ;
285- contacts_other[{age_group_80_plus, age_group_5_to_14}] = 0.0800 ;
286- contacts_other[{age_group_80_plus, age_group_15_to_34}] = 0.3480 ;
287- contacts_other[{age_group_80_plus, age_group_35_to_59}] = 0.5588 ;
288- contacts_other[{age_group_80_plus, age_group_60_to_79}] = 0.2769 ;
289- contacts_other[{age_group_80_plus, age_group_80_plus}] = 0.0180 ;
150+ Eigen::MatrixXd contacts_other (n_age_groups, n_age_groups);
151+ contacts_other << 0.5170 , 0.3997 , 0.7957 , 0.9958 , 0.3239 , 0.0428 , 0.0632 , 0.9121 , 0.3254 , 0.4731 , 0.2355 , 0.0148 ,
152+ 0.0336 , 0.1604 , 1.7529 , 0.8622 , 0.1440 , 0.0077 , 0.0204 , 0.1444 , 0.5738 , 1.2127 , 0.3433 , 0.0178 , 0.0371 , 0.0393 ,
153+ 0.4171 , 0.9666 , 0.7495 , 0.0257 , 0.0791 , 0.0800 , 0.3480 , 0.5588 , 0.2769 , 0.0180 ;
290154
291- mio::CustomIndexArray<ScalarType, mio::AgeGroup, mio::AgeGroup> contacts_random (
292- {mio::AgeGroup (n_age_groups), mio::AgeGroup (n_age_groups)}, 1.0 );
155+ Eigen::MatrixXd contacts_random = Eigen::MatrixXd::Ones (n_age_groups, n_age_groups);
293156
294157 for (auto & loc : world.get_locations ()) {
295158 switch (loc.get_type ()) {
296- case mio::abm::LocationType::Home:
297- loc.get_infection_parameters ().get <mio::abm::ContactRates>() = contacts_home;
298- loc.get_infection_parameters ().get <mio::abm::ContactRates>().array () *= 1.4 ; // 17 hours //intensity
299- loc.get_infection_parameters ().get <mio::abm::ContactRates>().array () *= 15.0 ; // Intensity
300- break ;
301- case mio::abm::LocationType::School:
302- loc.get_infection_parameters ().get <mio::abm::ContactRates>() = contacts_school;
303- loc.get_infection_parameters ().get <mio::abm::ContactRates>().array () *= 4.8 ; // 5h
304- break ;
305- case mio::abm::LocationType::Work:
306- loc.get_infection_parameters ().get <mio::abm::ContactRates>() = contacts_work;
307- loc.get_infection_parameters ().get <mio::abm::ContactRates>().array () *= 3.0 * 0.5 ; // 7h
308- break ;
309- case mio::abm::LocationType::SocialEvent:
310- loc.get_infection_parameters ().get <mio::abm::ContactRates>() = contacts_other;
311- loc.get_infection_parameters ().get <mio::abm::ContactRates>().array () *= 1.2 ; // aufteilung
312- loc.get_infection_parameters ().get <mio::abm::ContactRates>().array () *= 2.0 ; // intensity
313- loc.get_infection_parameters ().get <mio::abm::ContactRates>().array () *= 6.0 ; // 4 hours
314- break ;
315- case mio::abm::LocationType::BasicsShop:
316- loc.get_infection_parameters ().get <mio::abm::ContactRates>() = contacts_other;
317- loc.get_infection_parameters ().get <mio::abm::ContactRates>().array () *= 0.8 ; // aufteilung
318- loc.get_infection_parameters ().get <mio::abm::ContactRates>().array () *= 0.33 ; // intensity
319- loc.get_infection_parameters ().get <mio::abm::ContactRates>().array () *= 12.0 ; // 2 hours
320- break ;
321- default :
322- loc.get_infection_parameters ().get <mio::abm::ContactRates>() = contacts_random;
323- break ;
159+ {
160+ case mio::abm::LocationType::Home:
161+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () = contacts_home;
162+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () *=
163+ 1.4 ; // 17 hours //intensity
164+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () *= 15.0 ; // Intensity
165+ break ;
166+ case mio::abm::LocationType::School:
167+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () = contacts_school;
168+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () *= 4.8 ; // 5h
169+ break ;
170+ case mio::abm::LocationType::Work:
171+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () = contacts_work;
172+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () *= 3.0 * 0.5 ; // 7h
173+ break ;
174+ case mio::abm::LocationType::SocialEvent:
175+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () = contacts_other;
176+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () *= 1.2 ; // aufteilung
177+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () *= 2.0 ; // intensity
178+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () *= 6.0 ; // 4 hours
179+ break ;
180+ case mio::abm::LocationType::BasicsShop:
181+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () = contacts_other;
182+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () *= 0.8 ; // aufteilung
183+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () *= 0.33 ; // intensity
184+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () *= 12.0 ; // 2 hours
185+ break ;
186+ default :
187+ loc.get_infection_parameters ().get <mio::abm::ContactRates>().get_baseline () = contacts_random;
188+ break ;
189+ }
324190 }
325191 }
326192}
0 commit comments