Stride Reference Manual  - generated for commit 9643b11
GeoGridConfig.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This is free software: you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * any later version.
7  * The software is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License
12  * along with the software. If not, see <http://www.gnu.org/licenses/>.
13  *
14  * Copyright 2018, 2019, Jan Broeckhove and Bistromatics group.
15  */
16 
17 #include "contact/ContactPool.h"
19 #include "pop/Person.h"
20 #include "util/SegmentedVector.h"
21 
22 #include <boost/property_tree/ptree_fwd.hpp>
23 
24 #include <memory>
25 #include <ostream>
26 
27 namespace geopop {
28 
29 class GeoGrid;
30 
36 {
37 public:
39  GeoGridConfig();
40 
42  explicit GeoGridConfig(const boost::property_tree::ptree& configPt);
43 
47  stride::ContactType::IdSubscriptArray<unsigned int> people {0U, 500U, 3000U, 20U, 2000U, 2000U};
48 
53 
54  // -----------------------------------------------------------------------------------------
55  // Parameters set by constructor with configuration property tree.
56  // -----------------------------------------------------------------------------------------
57  struct
58  {
61 
65 
68 
71 
73  unsigned int pop_size;
74  } param;
75 
76  // -----------------------------------------------------------------------------------------
77  // The reference Households used to generate the population by random draws.
78  // -----------------------------------------------------------------------------------------
79  struct
80  {
82  unsigned int person_count = 0U;
83 
85  std::vector<std::vector<unsigned int>> ages{};
86  } refHH;
87 
88  // -----------------------------------------------------------------------------------------
89  // These are numbers derived from the reference households, the target size of the generated
90  // population and the input parameters relating participation in college and workplace.
91  // These numbers are used as targets in the population generation process and are reproduced
92  // (to very close approximation) in the generated population.
93  // The numbers are set by the SetData method.
94  // -----------------------------------------------------------------------------------------
95  struct
96  {
98  unsigned int popcount_k12school;
99 
101  unsigned int popcount_college;
102 
104  unsigned int popcount_workplace;
105 
107  unsigned int count_households;
108  } info;
109 
110  // -----------------------------------------------------------------------------------------
112  // -----------------------------------------------------------------------------------------
113  void SetData(const std::string& householdsFileName);
114 };
115 
116 } // namespace geopop
Header file for the Person class.
struct geopop::GeoGridConfig::@2 info
Configuration data mostly for generating a population, but also for computing the required number of ...
Definition: GeoGridConfig.h:35
Header for the core ContactPool class.
void SetData(const std::string &householdsFileName)
Read the househould data file, parse it and set data.
GeoGridConfig()
Default constructor needed in test code.
struct geopop::GeoGridConfig::@1 refHH
double particpation_workplace
Participation of workplace (fraction of people of work age and not going to college and having employ...
Definition: GeoGridConfig.h:64
unsigned int popcount_k12school
Numbers of individuals in K12School.
Definition: GeoGridConfig.h:98
Interface and implementation for SegmentedVector class.
unsigned int popcount_workplace
Number of individuals in Workplace.
unsigned int pop_size
Target population size for the generated population.
Definition: GeoGridConfig.h:73
Namespace for the geographic and demograhic classes.
Definition: Coordinate.h:21
Container for the contact pools of various type (household, work, ...).
stride::ContactType::IdSubscriptArray< unsigned int > people
People per unit (= Household, K12School, College, etc.) for each of the ContactTypes.
Definition: GeoGridConfig.h:47
double fraction_college_commuters
Fraction of college students that commute.
Definition: GeoGridConfig.h:67
struct geopop::GeoGridConfig::@0 param
unsigned int count_households
The number of households.
unsigned int popcount_college
Number of individuals in College.
double fraction_workplace_commuters
Fraction of people in the workplace that commute.
Definition: GeoGridConfig.h:70
std::vector< std::vector< unsigned int > > ages
Age profile per reference household.
Definition: GeoGridConfig.h:85
unsigned int person_count
Number of persons in the reference household set.
Definition: GeoGridConfig.h:82
double participation_college
Participation of college (fraction of people of college age going to college).
Definition: GeoGridConfig.h:60
stride::ContactType::IdSubscriptArray< unsigned int > pools
Pools per unit (= Household, K12School, College, etc.) for each of the ContactTypes.
Definition: GeoGridConfig.h:52