Health-GPS
1.2.2.0
Global Health Policy Simulation model (Health-GPS)
|
Top-level namespace for Health-GPS Console host application. More...
Namespaces | |
detail | |
Internal details namespace for private data types and functions. | |
poco | |
Plain old class object (POCO) types for loading configuration file. | |
Classes | |
class | EventMonitor |
Defined the event monitor class used for processing Health-GPS event messages. More... | |
struct | ExperimentInfo |
Simulation experiment run-time information for reproducibility. More... | |
struct | CommandOptions |
Defines the Command Line Interface (CLI) arguments options. More... | |
struct | Configuration |
Defines the application configuration data structure. More... | |
class | ResultFileWriter |
Defines the results message file stream writer class. More... | |
class | ResultWriter |
Defines the Health-GPS results message writer interface. More... | |
Functions | |
std::string | get_time_now_str () |
Get a string representation of current system time. More... | |
cxxopts::Options | create_options () |
Creates the command-line interface (CLI) options. More... | |
void | print_app_title () |
Prints application start-up messages. More... | |
CommandOptions | parse_arguments (cxxopts::Options &options, int &argc, char *argv[]) |
Parses the command-line interface (CLI) arguments. More... | |
Configuration | load_configuration (CommandOptions &options) |
Loads the input configuration file, *.json, information. More... | |
bool | create_output_folder (std::filesystem::path folder_path, unsigned int num_retries=3) |
Creates the configuration output folder for result files. More... | |
std::vector< core::DiseaseInfo > | get_diseases_info (hgps::core::Datastore &data_api, Configuration &config) |
Gets the collection of diseases that matches the selected input list. More... | |
ModelInput | create_model_input (core::DataTable &input_table, core::Country country, Configuration &config, std::vector< core::DiseaseInfo > diseases) |
std::string | create_output_file_name (const poco::OutputInfo &info, int job_id) |
Creates the full output file name from user input configuration. More... | |
ResultFileWriter | create_results_file_logger (const Configuration &config, const hgps::ModelInput &input) |
Creates the simulation results file logger instance. More... | |
std::unique_ptr< hgps::Scenario > | create_baseline_scenario (hgps::SyncChannel &channel) |
Creates the baseline scenario instance. More... | |
hgps::HealthGPS | create_baseline_simulation (hgps::SyncChannel &channel, hgps::SimulationModuleFactory &factory, hgps::EventAggregator &event_bus, hgps::ModelInput &input) |
Creates the baseline simulation engine instance. More... | |
hgps::HealthGPS | create_intervention_simulation (hgps::SyncChannel &channel, hgps::SimulationModuleFactory &factory, hgps::EventAggregator &event_bus, hgps::ModelInput &input, const poco::PolicyScenarioInfo &info) |
Creates the intervention simulation engine instance. More... | |
std::unique_ptr< hgps::InterventionScenario > | create_intervention_scenario (hgps::SyncChannel &channel, const poco::PolicyScenarioInfo &info) |
Creates the intervention scenario instance. More... | |
std::string | expand_environment_variables (const std::string &path) |
Expand environment variables in path to respective values. More... | |
std::optional< unsigned int > | create_job_seed (int job_id, std::optional< unsigned int > user_seed) |
Creates the experiment random number generator seed. More... | |
hgps::ModelInput | create_model_input (hgps::core::DataTable &input_table, hgps::core::Country country, Configuration &config, std::vector< hgps::core::DiseaseInfo > diseases) |
Creates Health-GPS inputs instance from configuration. More... | |
bool | load_datatable_from_csv (hc::DataTable &out_table, std::string full_filename, std::map< std::string, std::string > columns, std::string delimiter=",") |
Populates a datatable with the input data file contents. More... | |
std::map< hc::Identifier, std::vector< double > > | load_baseline_from_csv (const std::string &full_filename, const std::string delimiter=",") |
Loads the contents of baseline adjustments file into a table. More... | |
hgps::BaselineAdjustment | load_baseline_adjustments (const poco::BaselineInfo &info) |
Loads baseline adjustments information from a file. More... | |
std::unique_ptr< hgps::RiskFactorModelDefinition > | load_static_risk_model_definition (const std::string &model_name, const poco::json &opt) |
Loads the full hierarchical linear regression model definition from a JSON file. More... | |
std::unique_ptr< hgps::RiskFactorModelDefinition > | load_dynamic_risk_model_definition (const std::string &model_name, const poco::json &opt, const poco::SettingsInfo &settings) |
Loads a dynamic model from a JSON file. More... | |
std::unique_ptr< hgps::LiteHierarchicalModelDefinition > | load_ebhlm_risk_model_definition (const poco::json &opt) |
Loads the old energy balance model definition from a JSON file. More... | |
std::unique_ptr< hgps::EnergyBalanceModelDefinition > | load_newebm_risk_model_definition (const poco::json &opt, const poco::SettingsInfo &settings) |
Loads the new energy balance model definition from a JSON file. More... | |
std::pair< hgps::HierarchicalModelType, std::unique_ptr< hgps::RiskFactorModelDefinition > > | load_risk_model_definition (const std::string &model_type, const poco::json &opt, const poco::SettingsInfo &settings) |
Loads a risk model definition from a JSON file. More... | |
poco::json | load_json (const std::string &model_filename) |
Load and parse the model file. More... | |
void | register_risk_factor_model_definitions (hgps::CachedRepository &repository, const poco::ModellingInfo &info, const poco::SettingsInfo &settings) |
Registers a risk factor model definition with the repository. More... | |
Top-level namespace for Health-GPS Console host application.
std::unique_ptr< hgps::Scenario > host::create_baseline_scenario | ( | hgps::SyncChannel & | channel | ) |
Creates the baseline scenario instance.
channel | Synchronization channel instance for data exchange |
hgps::HealthGPS host::create_baseline_simulation | ( | hgps::SyncChannel & | channel, |
hgps::SimulationModuleFactory & | factory, | ||
hgps::EventAggregator & | event_bus, | ||
hgps::ModelInput & | input | ||
) |
Creates the baseline simulation engine instance.
channel | Synchronization channel for data exchange instance |
factory | Simulation module factory instance |
event_bus | Shared event bus instance for streaming messages |
input | Model inputs instance |
std::unique_ptr< hgps::InterventionScenario > host::create_intervention_scenario | ( | hgps::SyncChannel & | channel, |
const poco::PolicyScenarioInfo & | info | ||
) |
Creates the intervention scenario instance.
channel | Synchronization channel instance for data exchange |
info | Intervention configuration information |
std::invalid_argument | Thrown if intervention identifier is unknown. |
hgps::HealthGPS host::create_intervention_simulation | ( | hgps::SyncChannel & | channel, |
hgps::SimulationModuleFactory & | factory, | ||
hgps::EventAggregator & | event_bus, | ||
hgps::ModelInput & | input, | ||
const poco::PolicyScenarioInfo & | info | ||
) |
Creates the intervention simulation engine instance.
channel | Synchronization channel for data exchange instance |
factory | Simulation module factory instance |
event_bus | Shared event bus instance for streaming messages |
input | Model inputs instance |
info | Intervention policy definition |
std::optional< unsigned int > host::create_job_seed | ( | int | job_id, |
std::optional< unsigned int > | user_seed | ||
) |
Creates the experiment random number generator seed.
job_id | Optional batch job identifier |
user_seed | User input custom seed for experiment |
ModelInput host::create_model_input | ( | core::DataTable & | input_table, |
core::Country | country, | ||
Configuration & | config, | ||
std::vector< core::DiseaseInfo > | diseases | ||
) |
hgps::ModelInput host::create_model_input | ( | hgps::core::DataTable & | input_table, |
hgps::core::Country | country, | ||
Configuration & | config, | ||
std::vector< hgps::core::DiseaseInfo > | diseases | ||
) |
Creates Health-GPS inputs instance from configuration.
input_table | The input dataset instance |
country | Target country information |
config | User input configuration instance |
diseases | Selected diseases for experiment |
cxxopts::Options host::create_options | ( | ) |
Creates the command-line interface (CLI) options.
std::string host::create_output_file_name | ( | const poco::OutputInfo & | info, |
int | job_id | ||
) |
Creates the full output file name from user input configuration.
info | User output information, may contain relative path and environment variables |
job_id | Simulation job identifier |
bool host::create_output_folder | ( | std::filesystem::path | folder_path, |
unsigned int | num_retries = 3 |
||
) |
Creates the configuration output folder for result files.
folder_path | Full path to output folder |
num_retries | Number of attempts before giving up |
ResultFileWriter host::create_results_file_logger | ( | const Configuration & | config, |
const hgps::ModelInput & | input | ||
) |
Creates the simulation results file logger instance.
config | User input configuration information |
input | Model input instance |
std::string host::expand_environment_variables | ( | const std::string & | path | ) |
Expand environment variables in path to respective values.
path | The source path to information |
std::vector< hgps::core::DiseaseInfo > host::get_diseases_info | ( | hgps::core::Datastore & | data_api, |
Configuration & | config | ||
) |
Gets the collection of diseases that matches the selected input list.
data_api | The back-end data store instance to be used. |
config | User configuration file instance |
std::string host::get_time_now_str | ( | ) |
Get a string representation of current system time.
hgps::BaselineAdjustment host::load_baseline_adjustments | ( | const poco::BaselineInfo & | info | ) |
Loads baseline adjustments information from a file.
info | Baseline file information |
std::map< hc::Identifier, std::vector< double > > host::load_baseline_from_csv | ( | const std::string & | full_filename, |
const std::string | delimiter = "," |
||
) |
Loads the contents of baseline adjustments file into a table.
full_filename | The baseline adjustment file full path |
delimiter | The data file's columns delimiter character |
Configuration host::load_configuration | ( | CommandOptions & | options | ) |
Loads the input configuration file, *.json, information.
options | User command-line options |
bool host::load_datatable_from_csv | ( | hc::DataTable & | out_table, |
std::string | full_filename, | ||
std::map< std::string, std::string > | columns, | ||
std::string | delimiter = "," |
||
) |
Populates a datatable with the input data file contents.
[out] | out_table | The datatable to be populated with the inputs data |
full_filename | The input data file full path | |
columns | The data file columns data type | |
delimiter | The data file's columns delimiter character |
std::unique_ptr< hgps::RiskFactorModelDefinition > host::load_dynamic_risk_model_definition | ( | const std::string & | model_name, |
const poco::json & | opt, | ||
const poco::SettingsInfo & | settings | ||
) |
Loads a dynamic model from a JSON file.
model_name | The name of the model to use |
opt | The parsed model definition JSON file |
settings | The main model settings |
std::invalid_argument | if dynamic model is unrecognised |
std::unique_ptr< hgps::LiteHierarchicalModelDefinition > host::load_ebhlm_risk_model_definition | ( | const poco::json & | opt | ) |
Loads the old energy balance model definition from a JSON file.
opt | The parsed model definition JSON file |
poco::json host::load_json | ( | const std::string & | model_filename | ) |
Load and parse the model file.
model_filename | The path to the model |
std::invalid_argument | if file is missing |
std::unique_ptr< hgps::EnergyBalanceModelDefinition > host::load_newebm_risk_model_definition | ( | const poco::json & | opt, |
const poco::SettingsInfo & | settings | ||
) |
Loads the new energy balance model definition from a JSON file.
opt | The parsed model definition JSON file |
settings | The main model settings |
std::pair< hgps::HierarchicalModelType, std::unique_ptr< hgps::RiskFactorModelDefinition > > host::load_risk_model_definition | ( | const std::string & | model_type, |
const poco::json & | opt, | ||
const poco::SettingsInfo & | settings | ||
) |
Loads a risk model definition from a JSON file.
model_type | The type of model ("dynamic"/"static") to load |
opt | The parsed model definition JSON file |
settings | The main model settings |
std::unique_ptr< hgps::RiskFactorModelDefinition > host::load_static_risk_model_definition | ( | const std::string & | model_name, |
const poco::json & | opt | ||
) |
Loads the full hierarchical linear regression model definition from a JSON file.
model_name | The name of the model to use |
opt | The parsed model definition JSON file |
std::invalid_argument | if static model is unrecognised |
CommandOptions host::parse_arguments | ( | cxxopts::Options & | options, |
int & | argc, | ||
char * | argv[] | ||
) |
Parses the command-line interface (CLI) arguments.
options | The valid CLI options |
argc | Number of input arguments |
argv | List of input arguments |
void host::print_app_title | ( | ) |
Prints application start-up messages.
void host::register_risk_factor_model_definitions | ( | hgps::CachedRepository & | repository, |
const poco::ModellingInfo & | info, | ||
const poco::SettingsInfo & | settings | ||
) |
Registers a risk factor model definition with the repository.
repository | The repository instance to register |
info | The model definition information |
settings | The associated experiment settings |