32 #include <boost/filesystem.hpp> 33 #include <boost/filesystem/path.hpp> 34 namespace filesys = boost::filesystem;
37 namespace filesys = std::filesystem;
40 #include <boost/property_tree/ptree.hpp> 43 #include <spdlog/spdlog.h> 52 GenPopController::GenPopController(
const ptree& config,
const string& name) :
ControlHelper(config, name) {}
67 const RnInfo info{
m_config.get<
string>(
"run.rng_seed",
"1,2,3,4"),
"",
68 m_config.get<
unsigned int>(
"run.num_threads")};
78 geoPopBuilder.
Build(pop);
87 const auto prefix =
m_config.get<
string>(
"run.output_prefix");
88 const auto popFileName =
m_config.get<
string>(
"run.population_file",
"genpop.proto");
90 m_stride_logger->info(
"Population written to file {}.", popFilePath.string());
92 ofstream outputFileStream(popFilePath.string());
93 geoGridWriter->Write(pop->RefGeoGrid(), outputFileStream);
94 outputFileStream.close();
std::shared_ptr< Population > Build(std::shared_ptr< Population > pop) override
Generates a synthetic population.
Header for the command line controller.
boost::property_tree::ptree m_config
Main configuration for run and sim.
void CheckEnv()
Check install environment.
static std::shared_ptr< Population > Create()
Create an empty Population, used in gengeopop.
Utilities for the project.
std::shared_ptr< spdlog::logger > m_stride_logger
General logger.
void LogStartup()
Logs info on setup for cli environment to stride_logger.
static std::shared_ptr< GeoGridWriter > CreateGeoGridWriter(const std::string &filename)
Create a GeoGridWriter based on the provided extension in the filename.
Namespace for the geographic and demograhic classes.
static filesys::path BuildPath(const std::string &output_prefix, const std::string &filename)
Interpret prefix (directory or filename prefix) and return appropriate path.
Builds poulation of a geographic grid.
Header file for the core Population class.
Controls a simulation run initiated with the command line interface (cli).
Interface for install directory queries.
Namespace for the simulator and related classes.
Information on random number management state.
void InstallLogger()
Make the appropriate logger for cli environment and register as stride_logger.
void Control()
Actual run of the simulator.