|
Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
|
Data structures containing model parameters and configuration options. More...
Classes | |
| struct | Array2Info |
| struct | BaselineInfo |
| Baseline adjustment information. More... | |
| struct | CoefficientInfo |
| struct | Configuration |
| Defines the application configuration data structure. More... | |
| class | ConfigurationError |
| Represents an error that occurred with the format of a config file. More... | |
| class | DataManager |
| Implements Health-GPS back-end data store interface using a file-based storage. More... | |
| class | DataSource |
| Represents a data source, either a file/directory path or a URL. More... | |
| struct | FactorDynamicEquationInfo |
| struct | FileInfo |
| Information about a data file to be loaded. More... | |
| struct | HierarchicalLevelInfo |
| struct | HierarchicalModelInfo |
| struct | IncomeStratumFactorsMeanConfig |
| struct | IncomeStratumFactorsMeanStratumEntry |
| struct | IndividualIdTrackingConfig |
| struct | LinearModelInfo |
| struct | LiteHierarchicalModelInfo |
| struct | ModellingInfo |
| User-defined model and parameter information. More... | |
| struct | OutputInfo |
| Experiment output folder and file information. More... | |
| class | PIFData |
| PIF data container for multiple scenarios. More... | |
| struct | PIFDataItem |
| PIF data item for a specific age, gender, and time. More... | |
| struct | PIFInfo |
| Population Impact Fraction (PIF) configuration. More... | |
| class | PIFTable |
| PIF data table for a specific disease-risk factor-scenario combination. More... | |
| struct | PolicyAdjustmentInfo |
| Extra adjustments made to a policy. More... | |
| struct | PolicyImpactInfo |
| Information about policy impacts. More... | |
| struct | PolicyPeriodInfo |
| Information about the period over which a policy is applied. More... | |
| struct | PolicyScenarioInfo |
| Information about an active policy intervention. More... | |
| struct | ProjectRequirements |
| struct | RiskFactorInfo |
| Information about a health risk factor. More... | |
| struct | SESInfo |
| Socio-economic status (SES) model inputs. More... | |
| struct | SettingsInfo |
| Experiment's population settings. More... | |
| class | ValidatedDataSource |
| A data source which is validated with a checksum. More... | |
| struct | VariableInfo |
Typedefs | |
| using | json = nlohmann::json |
| JSON parser namespace alias. | |
Functions | |
| Configuration | get_configuration (const std::string &config_source, const std::optional< std::string > &output_folder, int job_id, bool verbose) |
| Loads the input configuration file, *.json, information. | |
| 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. | |
| ModelInput | create_model_input (core::DataTable &input_table, core::Country country, const Configuration &config, std::vector< core::DiseaseInfo > diseases) |
| std::string | create_output_file_name (const OutputInfo &info, int job_id) |
| Creates the full output file name from user input configuration. | |
| std::unique_ptr< hgps::Scenario > | create_baseline_scenario (hgps::SyncChannel &channel) |
| Creates the baseline scenario instance. | |
| hgps::Simulation | create_baseline_simulation (hgps::SyncChannel &channel, hgps::SimulationModuleFactory &factory, std::shared_ptr< const hgps::EventAggregator > event_bus, std::shared_ptr< const hgps::ModelInput > input) |
| Creates the baseline simulation engine instance. | |
| std::unique_ptr< hgps::Scenario > | create_intervention_scenario (hgps::SyncChannel &channel, const PolicyScenarioInfo &info) |
| Creates the intervention scenario instance. | |
| hgps::Simulation | create_intervention_simulation (hgps::SyncChannel &channel, hgps::SimulationModuleFactory &factory, std::shared_ptr< const hgps::EventAggregator > event_bus, std::shared_ptr< const hgps::ModelInput > input, const PolicyScenarioInfo &info) |
| Creates the intervention simulation engine instance. | |
| std::string | expand_environment_variables (const std::string &path) |
| Expand environment variables in path to respective values. | |
| std::optional< unsigned int > | create_job_seed (int job_id, std::optional< unsigned int > user_seed) |
| Creates the experiment random number generator seed. | |
| hgps::ModelInput | create_model_input (hgps::core::DataTable &input_table, hgps::core::Country country, const Configuration &config, std::vector< hgps::core::DiseaseInfo > diseases) |
| Creates Health-GPS inputs instance from configuration. | |
| nlohmann::json | get (const nlohmann::json &j, const std::string &key) |
| Load value from JSON, printing an error message if it fails. | |
| void | rebase_valid_path (std::filesystem::path &path, const std::filesystem::path &base_dir) |
| Rebase path on base_dir. | |
| bool | rebase_valid_path_to (const nlohmann::json &j, const std::string &key, std::filesystem::path &out, const std::filesystem::path &base_dir) noexcept |
| Get a valid path from a JSON object. | |
| void | rebase_valid_path_to (const nlohmann::json &j, const std::string &key, std::filesystem::path &out, const std::filesystem::path &base_dir, bool &success) noexcept |
| Get a valid path from a JSON object. | |
| FileInfo | get_file_info (const nlohmann::json &node, const std::filesystem::path &base_dir) |
| Load FileInfo from JSON. | |
| SettingsInfo | get_settings (const nlohmann::json &j) |
| Load settings section of JSON. | |
| BaselineInfo | get_baseline_info (const nlohmann::json &j, const std::filesystem::path &base_dir) |
| Load BaselineInfo from JSON. | |
| void | load_interventions (const nlohmann::json &running, Configuration &config) |
| Load interventions from running section. | |
| void | check_version (const nlohmann::json &j) |
| Check the schema version and throw if invalid. | |
| void | load_input_info (const nlohmann::json &j, Configuration &config) |
| Load input dataset. | |
| void | load_modelling_info (const nlohmann::json &j, Configuration &config) |
| Load ModellingInfo from JSON. | |
| void | load_running_info (const nlohmann::json &j, Configuration &config) |
| Load running section of JSON object. | |
| void | load_output_info (const nlohmann::json &j, Configuration &config, const std::optional< std::string > &output_folder) |
| Load output section of JSON object. | |
| template<class T > | |
| bool | get_to (const nlohmann::json &j, const std::string &key, T &out) noexcept |
| Get value from JSON object and store in out. | |
| template<class T > | |
| bool | get_to (const nlohmann::json &j, const std::string &key, T &out, bool &success) noexcept |
| Get value from JSON object and store in out, setting success flag. | |
| void | reject_deprecated_root_config_fields (const nlohmann::json &opt) |
| Reject deprecated root-level fields when project_requirements is the source of truth. | |
| void | validate_legacy_trend_type_string (const std::string &trend_type) |
| void | apply_legacy_root_config_fields (const nlohmann::json &opt, ProjectRequirements &req) |
| Map legacy root-level trend_type / income_categories into project_requirements. | |
| void | parse_project_requirements_block (const nlohmann::json &pr, ProjectRequirements &req) |
| Parse project_requirements block from config.json. | |
| hgps::core::DataTable | load_datatable_from_csv (const FileInfo &file_info) |
| Populates a datatable with the input data file contents. | |
| std::unordered_map< hgps::core::Identifier, std::vector< double > > | load_baseline_from_csv (const std::string &filename, const std::string &delimiter=",") |
| Loads the contents of baseline adjustments file into a table. | |
| void | download_file (const std::string &url, const std::filesystem::path &download_path) |
| Download the file at the specified URL. | |
| std::filesystem::path | download_file_to_temporary (const std::string &url, const std::string &file_extension) |
| Download the file at the specified URL to a temporary folder. | |
| void | to_json (json &j, const FileInfo &p) |
| void | to_json (json &j, const CoefficientInfo &p) |
| void | from_json (const json &j, CoefficientInfo &p) |
| void | to_json (json &j, const LinearModelInfo &p) |
| void | from_json (const json &j, LinearModelInfo &p) |
| void | to_json (json &j, const Array2Info &p) |
| void | from_json (const json &j, Array2Info &p) |
| void | to_json (json &j, const HierarchicalLevelInfo &p) |
| void | from_json (const json &j, HierarchicalLevelInfo &p) |
| void | to_json (json &j, const SettingsInfo &p) |
| void | from_json (const json &j, SettingsInfo &p) |
| void | to_json (json &j, const RiskFactorInfo &p) |
| void | from_json (const json &j, RiskFactorInfo &p) |
| void | to_json (json &j, const SESInfo &p) |
| void | from_json (const json &j, SESInfo &p) |
| void | to_json (json &j, const VariableInfo &p) |
| void | from_json (const json &j, VariableInfo &p) |
| void | to_json (json &j, const FactorDynamicEquationInfo &p) |
| void | from_json (const json &j, FactorDynamicEquationInfo &p) |
| void | to_json (json &j, const IncomeStratumFactorsMeanStratumEntry &p) |
| void | to_json (json &j, const IncomeStratumFactorsMeanConfig &p) |
| void | to_json (json &j, const BaselineInfo &p) |
| void | to_json (json &j, const PolicyPeriodInfo &p) |
| void | from_json (const json &j, PolicyPeriodInfo &p) |
| void | to_json (json &j, const PolicyImpactInfo &p) |
| void | from_json (const json &j, PolicyImpactInfo &p) |
| void | to_json (json &j, const PolicyAdjustmentInfo &p) |
| void | from_json (const json &j, PolicyAdjustmentInfo &p) |
| void | to_json (json &j, const PolicyScenarioInfo &p) |
| void | from_json (const json &j, PolicyScenarioInfo &p) |
| void | to_json (json &j, const IndividualIdTrackingConfig &p) |
| void | from_json (const json &j, IndividualIdTrackingConfig &p) |
| void | to_json (json &j, const OutputInfo &p) |
| void | from_json (const json &j, OutputInfo &p) |
| nlohmann::json | load_json (const std::filesystem::path &filepath) |
| Load and parse a JSON model file. | |
| std::unique_ptr< hgps::RiskFactorSexAgeTable > | load_risk_factor_expected (const Configuration &config) |
| Loads risk factor expected values from a file. | |
| std::unique_ptr< hgps::DummyModelDefinition > | load_dummy_risk_model_definition (hgps::RiskFactorModelType type, const nlohmann::json &opt) |
| Loads either a static or dynamic dummy risk factor model from a JSON file. | |
| std::unique_ptr< hgps::StaticHierarchicalLinearModelDefinition > | load_hlm_risk_model_definition (const nlohmann::json &opt) |
| Loads the full hierarchical linear regression model definition from a JSON file. | |
| std::unique_ptr< hgps::StaticLinearModelDefinition > | load_staticlinear_risk_model_definition (const nlohmann::json &opt, const Configuration &config) |
| Loads the static linear regression model definition from a JSON file. | |
| std::unique_ptr< hgps::DynamicHierarchicalLinearModelDefinition > | load_ebhlm_risk_model_definition (const nlohmann::json &opt, const Configuration &config) |
| Loads the old energy balance model definition from a JSON file. | |
| std::unique_ptr< hgps::KevinHallModelDefinition > | load_kevinhall_risk_model_definition (const nlohmann::json &opt, const Configuration &config) |
| Loads the Kevin Hall energy balance model definition from a JSON file. | |
| std::unique_ptr< hgps::RiskFactorModelDefinition > | load_risk_model_definition (hgps::RiskFactorModelType model_type, const std::filesystem::path &model_path, const Configuration &config) |
| Loads a risk model definition from a JSON file. | |
| void | register_risk_factor_model_definitions (hgps::CachedRepository &repository, const Configuration &config) |
| Registers a risk factor model definition with the repository. | |
| void | validate_json (std::istream &is, const std::string &schema_file_name, int schema_version) |
| Validate a JSON stream against the specified schema. | |
| nlohmann::json | load_and_validate_json (const std::filesystem::path &file_path, const std::string &schema_file_name, int schema_version, bool require_schema_property=true) |
| Load a JSON file and validate against the specified schema. | |
| std::filesystem::path | get_zip_cache_directory (const std::string &file_hash) |
| Get cache directory for extracting a file into. | |
| void | extract_zip_file (const std::filesystem::path &file_path, const std::filesystem::path &output_directory) |
| Extract a zip file to the specified location. | |
Data structures containing model parameters and configuration options.
POCO stands for "plain old class object". These structs represent data structures which are contained in JSON-formatted configuration files.
| typedef nlohmann::json hgps::input::json |
JSON parser namespace alias.
|
inline |
Map legacy root-level trend_type / income_categories into project_requirements.
| void hgps::input::check_version | ( | const nlohmann::json & | j | ) |
Check the schema version and throw if invalid.
| j | The root JSON object |
| ConfigurationError | If version attribute is not present or invalid |
| std::unique_ptr< hgps::Scenario > hgps::input::create_baseline_scenario | ( | hgps::SyncChannel & | channel | ) |
Creates the baseline scenario instance.
| channel | Synchronization channel instance for data exchange |
| hgps::Simulation hgps::input::create_baseline_simulation | ( | hgps::SyncChannel & | channel, |
| hgps::SimulationModuleFactory & | factory, | ||
| std::shared_ptr< const hgps::EventAggregator > | event_bus, | ||
| std::shared_ptr< const 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::Scenario > hgps::input::create_intervention_scenario | ( | hgps::SyncChannel & | channel, |
| const 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::Simulation hgps::input::create_intervention_simulation | ( | hgps::SyncChannel & | channel, |
| hgps::SimulationModuleFactory & | factory, | ||
| std::shared_ptr< const hgps::EventAggregator > | event_bus, | ||
| std::shared_ptr< const hgps::ModelInput > | input, | ||
| const 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 > hgps::input::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 hgps::input::create_model_input | ( | core::DataTable & | input_table, |
| core::Country | country, | ||
| const Configuration & | config, | ||
| std::vector< core::DiseaseInfo > | diseases | ||
| ) |
| hgps::ModelInput hgps::input::create_model_input | ( | hgps::core::DataTable & | input_table, |
| hgps::core::Country | country, | ||
| const 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 |
| std::string hgps::input::create_output_file_name | ( | const 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 |
| void hgps::input::download_file | ( | const std::string & | url, |
| const std::filesystem::path & | download_path | ||
| ) |
Download the file at the specified URL.
| url | URL to download from |
| download_path | Destination for downloaded files, including filename |
| std::filesystem::path hgps::input::download_file_to_temporary | ( | const std::string & | url, |
| const std::string & | file_extension | ||
| ) |
Download the file at the specified URL to a temporary folder.
| url | URL to download from |
| file_extension | File extension (including dot) for downloaded file |
| std::string hgps::input::expand_environment_variables | ( | const std::string & | path | ) |
Expand environment variables in path to respective values.
| path | The source path to information |
| void hgps::input::extract_zip_file | ( | const std::filesystem::path & | file_path, |
| const std::filesystem::path & | output_directory | ||
| ) |
Extract a zip file to the specified location.
| file_path | The path to the zip file |
| output_directory | The path to the output folder |
| void hgps::input::from_json | ( | const json & | j, |
| Array2Info & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| CoefficientInfo & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| FactorDynamicEquationInfo & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| HierarchicalLevelInfo & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| IndividualIdTrackingConfig & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| LinearModelInfo & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| OutputInfo & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| PolicyAdjustmentInfo & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| PolicyImpactInfo & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| PolicyPeriodInfo & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| PolicyScenarioInfo & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| RiskFactorInfo & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| SettingsInfo & | p | ||
| ) |
| void hgps::input::from_json | ( | const json & | j, |
| VariableInfo & | p | ||
| ) |
| nlohmann::json hgps::input::get | ( | const nlohmann::json & | j, |
| const std::string & | key | ||
| ) |
Load value from JSON, printing an error message if it fails.
| j | JSON object |
| key | Key to value |
| ConfigurationError | Key not found |
| BaselineInfo hgps::input::get_baseline_info | ( | const nlohmann::json & | j, |
| const std::filesystem::path & | base_dir | ||
| ) |
Load BaselineInfo from JSON.
| j | Input JSON |
| base_dir | Base folder |
| ConfigurationError | One or more files could not be found |
| Configuration hgps::input::get_configuration | ( | const std::string & | config_source, |
| const std::optional< std::string > & | output_folder, | ||
| int | job_id, | ||
| bool | verbose | ||
| ) |
Loads the input configuration file, *.json, information.
| config_source | Path/URL for config source |
| output_folder | Path to output folder, if provided via command-line argument |
| job_id | Job ID (for HPC) |
| verbose | Set log verbosity for simulation |
| std::vector< hgps::core::DiseaseInfo > hgps::input::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 |
| FileInfo hgps::input::get_file_info | ( | const nlohmann::json & | node, |
| const std::filesystem::path & | base_dir | ||
| ) |
Load FileInfo from JSON.
| node | The node of the JSON object containing the FileInfo |
| base_dir | Base folder |
| ConfigurationError | Invalid config file format |
| SettingsInfo hgps::input::get_settings | ( | const nlohmann::json & | j | ) |
Load settings section of JSON.
| j | Input JSON |
| ConfigurationError | Could not load settings |
|
noexcept |
Get value from JSON object and store in out.
| T | Type of output object |
| j | JSON object |
| key | Key to value |
| out | Output object |
|
noexcept |
Get value from JSON object and store in out, setting success flag.
| T | Type of output object |
| j | JSON object |
| key | Key to value |
| out | Output object |
| success | Success flag, set to false in case of failure |
| std::filesystem::path hgps::input::get_zip_cache_directory | ( | const std::string & | file_hash | ) |
Get cache directory for extracting a file into.
| file_hash | The SHA256 hash of the file |
| nlohmann::json hgps::input::load_and_validate_json | ( | const std::filesystem::path & | file_path, |
| const std::string & | schema_file_name, | ||
| int | schema_version, | ||
| bool | require_schema_property = true |
||
| ) |
Load a JSON file and validate against the specified schema.
| file_path | The path to the JSON file |
| schema_file_name | The name of the JSON schema file |
| schema_version | The version of the schema file |
| require_schema_property | Whether to raise an exception if the $schema property is missing |
| std::unordered_map< hgps::core::Identifier, std::vector< double > > hgps::input::load_baseline_from_csv | ( | const std::string & | filename, |
| const std::string & | delimiter = "," |
||
| ) |
Loads the contents of baseline adjustments file into a table.
| filename | The baseline adjustment file full path |
| delimiter | The data file's columns delimiter character |
| hgps::core::DataTable hgps::input::load_datatable_from_csv | ( | const FileInfo & | file_info | ) |
Populates a datatable with the input data file contents.
| file_info | The input data file information object |
| std::unique_ptr< hgps::DummyModelDefinition > hgps::input::load_dummy_risk_model_definition | ( | hgps::RiskFactorModelType | type, |
| const nlohmann::json & | opt | ||
| ) |
Loads either a static or dynamic dummy risk factor model from a JSON file.
| type | Model type (static or dynamic) |
| opt | The parsed model definition JSON file |
| std::invalid_argument | if error parsing model configuration file |
| std::unique_ptr< hgps::DynamicHierarchicalLinearModelDefinition > hgps::input::load_ebhlm_risk_model_definition | ( | const nlohmann::json & | opt, |
| const Configuration & | config | ||
| ) |
Loads the old energy balance model definition from a JSON file.
| opt | The parsed model definition JSON file |
| std::unique_ptr< hgps::StaticHierarchicalLinearModelDefinition > hgps::input::load_hlm_risk_model_definition | ( | const nlohmann::json & | opt | ) |
Loads the full hierarchical linear regression model definition from a JSON file.
| opt | The parsed model definition JSON file |
| std::invalid_argument | if static model is unrecognised |
| void hgps::input::load_input_info | ( | const nlohmann::json & | j, |
| Configuration & | config | ||
| ) |
Load input dataset.
| j | The root JSON object |
| config | The config object to update |
| ConfigurationError | Could not load input dataset |
| void hgps::input::load_interventions | ( | const nlohmann::json & | running, |
| Configuration & | config | ||
| ) |
Load interventions from running section.
| running | Running section of JSON object |
| config | Config object to update |
| ConfigurationError | Could not load interventions |
| nlohmann::json hgps::input::load_json | ( | const std::filesystem::path & | filepath | ) |
Load and parse a JSON model file.
| model_path | The path to the model file |
| std::invalid_argument | if file is missing |
| std::unique_ptr< hgps::KevinHallModelDefinition > hgps::input::load_kevinhall_risk_model_definition | ( | const nlohmann::json & | opt, |
| const Configuration & | config | ||
| ) |
Loads the Kevin Hall energy balance model definition from a JSON file.
| opt | The parsed model definition JSON file |
| config | The model configuration |
| void hgps::input::load_modelling_info | ( | const nlohmann::json & | j, |
| Configuration & | config | ||
| ) |
Load ModellingInfo from JSON.
| j | The root JSON object |
| config | The config object to update |
| ConfigurationError | Could not load modelling info |
| void hgps::input::load_output_info | ( | const nlohmann::json & | j, |
| Configuration & | config, | ||
| const std::optional< std::string > & | output_folder | ||
| ) |
Load output section of JSON object.
| j | The root JSON object |
| config | The config object to update |
| output_folder | Output folder, if provided via command-line argument |
| ConfigurationError | Could not load output info |
| std::unique_ptr< hgps::RiskFactorSexAgeTable > hgps::input::load_risk_factor_expected | ( | const Configuration & | config | ) |
Loads risk factor expected values from a file.
| config | The model configuration |
| std::unique_ptr< hgps::RiskFactorModelDefinition > hgps::input::load_risk_model_definition | ( | hgps::RiskFactorModelType | model_type, |
| const std::filesystem::path & | model_path, | ||
| const Configuration & | config | ||
| ) |
Loads a risk model definition from a JSON file.
| model_type | The type of model to load |
| model_path | The path to the model configuration file |
| config | The model configuration |
| void hgps::input::load_running_info | ( | const nlohmann::json & | j, |
| Configuration & | config | ||
| ) |
Load running section of JSON object.
| j | The root JSON object |
| config | The config object to update |
| ConfigurationError | Could not load running section |
| std::unique_ptr< hgps::StaticLinearModelDefinition > hgps::input::load_staticlinear_risk_model_definition | ( | const nlohmann::json & | opt, |
| const Configuration & | config | ||
| ) |
Loads the static linear regression model definition from a JSON file.
| opt | The parsed model definition JSON file |
| config | The model configuration |
|
inline |
Parse project_requirements block from config.json.
| void hgps::input::rebase_valid_path | ( | std::filesystem::path & | path, |
| const std::filesystem::path & | base_dir | ||
| ) |
Rebase path on base_dir.
| path | Initial path (relative or absolute) |
| base_dir | New base directory for relative path |
| ConfigurationError | If path does not exist |
|
noexcept |
Get a valid path from a JSON object.
| j | JSON object |
| key | Key to value |
| base_dir | Base directory for relative path |
| out | Output variable |
|
noexcept |
Get a valid path from a JSON object.
| j | JSON object |
| key | Key to value |
| base_dir | Base directory for relative path |
| out | Output variable |
| success | Success flag, set to false in case of failure |
| void hgps::input::register_risk_factor_model_definitions | ( | hgps::CachedRepository & | repository, |
| const Configuration & | config | ||
| ) |
Registers a risk factor model definition with the repository.
| repository | The repository instance to register |
| config | The model configuration |
|
inline |
Reject deprecated root-level fields when project_requirements is the source of truth.
| void hgps::input::to_json | ( | json & | j, |
| const Array2Info & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const BaselineInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const CoefficientInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const FactorDynamicEquationInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const HierarchicalLevelInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const IncomeStratumFactorsMeanConfig & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const IncomeStratumFactorsMeanStratumEntry & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const IndividualIdTrackingConfig & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const LinearModelInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const OutputInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const PolicyAdjustmentInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const PolicyImpactInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const PolicyPeriodInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const PolicyScenarioInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const RiskFactorInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const SettingsInfo & | p | ||
| ) |
| void hgps::input::to_json | ( | json & | j, |
| const VariableInfo & | p | ||
| ) |
| void hgps::input::validate_json | ( | std::istream & | is, |
| const std::string & | schema_file_name, | ||
| int | schema_version | ||
| ) |
Validate a JSON stream against the specified schema.
| is | The input stream for the JSON file |
| schema_file_name | The name of the JSON schema file |
| schema_version | The version of the schema file |
|
inline |