@@ -77,14 +77,10 @@ int main(int argc, char* argv[])
7777 const auto age_group_60_to_79 = mio::AgeGroup (4 ); // seniors
7878 const auto age_group_80_plus = mio::AgeGroup (5 ); // elderly
7979
80- // *** Create the model and set infection parameters. ***
81- // The Model holds all persons, locations, and parameters. We hand over the
82- // number of age groups so that all parameter arrays are sized correctly.
83- // `set_local_parameters` and `set_world_parameters` fill in realistic
84- // epidemiological values (see parameter_setter.h).
80+ // *** Create the model. ***
81+ // The Model holds all persons, locations, and parameters. We need to add the locations
82+ // before we set the parameters as some parameters depend on the locations.
8583 auto model = mio::abm::Model (num_age_groups);
86- set_local_parameters (model);
87- set_world_parameters (model.parameters );
8884
8985 // Define which age groups are eligible to go to school and to work.
9086 // The AgeGroupGotoSchool / AgeGroupGotoWork arrays default to false for
@@ -187,6 +183,12 @@ int main(int argc, char* argv[])
187183 // One workplace for all working adults.
188184 auto work = model.add_location (mio::abm::LocationType::Work);
189185
186+ // *** Set paramters for all locations. ***
187+ // `set_local_parameters` and `set_world_parameters` fill in realistic
188+ // epidemiological values (see parameter_setter.h).
189+ set_local_parameters (model);
190+ set_world_parameters (model.parameters );
191+
190192 // *** Assign initial infection states. ***
191193 // Each person draws a random infection state from the distribution below.
192194 // Persons who are not Susceptible receive a full Infection object so their
0 commit comments