Stride Reference Manual  - generated for commit 9643b11
GeoPopBuilder.h
Go to the documentation of this file.
1 /*
2  * This is free software: you can redistribute it and/or modify it
3  * under the terms of the GNU General Public License as published by
4  * the Free Software Foundation, either version 3 of the License, or
5  * any later version.
6  * The software is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  * You should have received a copy of the GNU General Public License
11  * along with the software. If not, see <http://www.gnu.org/licenses/>.
12  *
13  * Copyright 2018, 2019 Jan Broeckhove and Bistromatics group.
14  */
15 
21 #pragma once
22 
23 #include "AbstractPopBuilder.h"
24 
25 #include <boost/property_tree/ptree_fwd.hpp>
26 
27 #include <memory>
28 
29 namespace geopop {
30 class GeoGrid;
31 class GeoGridConfig;
32 } // namespace geopop
33 
34 namespace stride {
35 
36 class Population;
37 
42 {
43 public:
45  // using AbstractPopBuilder::AbstractPopBuilder;
46 
51  GeoPopBuilder(const boost::property_tree::ptree& config, util::RnMan& rnMan,
52  std::shared_ptr<spdlog::logger> strideLogger = nullptr);
53 
55  std::shared_ptr<Population> Build(std::shared_ptr<Population> pop) override;
56 
57 private:
59  void MakeLocations(geopop::GeoGrid& geoGrid, const geopop::GeoGridConfig& geoGridConfig,
60  const std::string& citiesFileName, const std::string& commutingFileName);
61 
63  void MakePools(geopop::GeoGrid& geoGrid, const geopop::GeoGridConfig& geoGridConfig);
64 
66  void MakePersons(geopop::GeoGrid& geoGrid, const geopop::GeoGridConfig& geoGridConfig);
67 };
68 
69 } // namespace stride
std::shared_ptr< Population > Build(std::shared_ptr< Population > pop) override
Generates a synthetic population.
void MakeLocations(geopop::GeoGrid &geoGrid, const geopop::GeoGridConfig &geoGridConfig, const std::string &citiesFileName, const std::string &commutingFileName)
Read files with location data and constructs GeoGrid config.
Configuration data mostly for generating a population, but also for computing the required number of ...
Definition: GeoGridConfig.h:35
Base Class for PopBuilders.
void MakePools(geopop::GeoGrid &geoGrid, const geopop::GeoGridConfig &geoGridConfig)
Build and store the Geo part of the GeoGrid.
A Geographic grid of simulation region contains Locations that in turn contain an index to the Contac...
Definition: GeoGrid.h:41
Namespace for the geographic and demograhic classes.
Definition: Coordinate.h:21
Builds poulation of a geographic grid.
Definition: GeoPopBuilder.h:41
void MakePersons(geopop::GeoGrid &geoGrid, const geopop::GeoGridConfig &geoGridConfig)
Build and store the Pop part of the GeoGrid.
GeoPopBuilder(const boost::property_tree::ptree &config, util::RnMan &rnMan, std::shared_ptr< spdlog::logger > strideLogger=nullptr)
Use constructor of base.
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28
Base Class for PopBuilders.