Parameters: R6Class Parameters

Description Details Public fields Active bindings Methods See Also

Description

Wrapper class for the parameters C struct (params.h).

Details

For a detailed explanation of the available parameters (including sources and references), please read the Online Documentation.

Public fields

household_df

Household Data Frame.

Active bindings

c_params

the C param sR pointer object (SWIG wrapped)

Methods

Public methods


Method new()

Usage
Parameters$new(
  input_param_file = NA_character_,
  param_line_number = 1,
  output_file_dir = "./",
  input_households = NA_character_,
  hospital_input_param_file = NA_character_,
  hospital_param_line_number = NA_integer_,
  read_param_file = TRUE,
  read_hospital_param_file = FALSE
)
Arguments
input_param_file

Input parameters CSV file path. Optional, default: system.file("default_params", "baseline_parameters.csv", package = "OpenABMCovid19")

param_line_number

Which column of the input param file to read.

output_file_dir

Where to write output files to.

input_households

Household demographics file. Optional, default: system.file("default_params", "baseline_household_demographics.csv", package = "OpenABMCovid19")

hospital_input_param_file

Hospital input parameters CSV file path. Optional, default: system.file("default_params", "hospital_baseline_parameters.csv", package = "OpenABMCovid19")

hospital_param_line_number

Which column of the hospital input param file to read.

read_param_file

A boolean. If TRUE, read input_param_file. If FALSE, ignore input_param_file.

read_hospital_param_file

A boolean. If TRUE, read hospital_input_param_file. If FALSE, ignore hospital_input_param_file.


Method get_param()

Get a C parameter by name.

Usage
Parameters$get_param(param)
Arguments
param

A string representing the C parameter's name


Method set_param()

Set a C parameter by name.

Usage
Parameters$set_param(param, value)
Arguments
param

A string representing the C parameter's name

value

The new value for the C parameter.


Method set_param_list()

Set C parameters from a list.

Usage
Parameters$set_param_list(params)
Arguments
params

A named list with the name being the parameter


Method set_demographic_household_table()

Set the demographic_household_table C struct (defined in demographics.h). This function initializes the self$c_params$demo_house member.

Usage
Parameters$set_demographic_household_table(df_demo_house)
Arguments
df_demo_house

A data-frame representation of the demographic_household_table C struct. The data-frame must contain column names c("ID", "age_group", "house_no") and the number of rows must be equal to self$c_params$n_total.

Returns

TRUE on success, FALSE on error.


Method set_occupation_network_table()

Set the demographic_occupation_network_table C struct (defined in demographics.h). This function initializes the self$c_params$occupation_network_table member.

Usage
Parameters$set_occupation_network_table(
  df_occupation_networks,
  df_occupation_network_properties
)
Arguments
df_occupation_networks

TODO(olegat)

df_occupation_network_properties

TODO(olegat)


Method return_param_object()

Run a check on the parameters and return if the C code doesn't bail. This function locks the parameter value (i.e. make this class read-only))

Usage
Parameters$return_param_object()
Returns

self$c_params

See Also

Model

the C params R pointer object check the C params still exists


OpenABMCovid19 documentation built on July 20, 2021, 5:08 p.m.