get_runtime_parameters: Read the runtime parameters file and store them in...

Description Usage Arguments Details Examples

View source: R/get_runtime_parameters.R

Description

Read the runtime parameters file and store them in environment

Usage

1
2
get_runtime_parameters(propertiesFN, format = "java", delimiter = "=",
  import_flag = "&", echo_parameters = TRUE, save_to = NULL)

Arguments

propertiesFN

Filename containing the runtime parameters, with full path information included in the filename

format

The format the runtime parameters are stored in within the file, which includes java (the default, and currently only supported format) and xml (future)

delimiter

The character used to separate the parameter name from its value (defaults to '=', not relevant for XML format)

import_flag

Some parameters are tables stored in external files in command separated value (CSV) format. This parameter, when it precedes the runtime parameter value, signals the function that the value string is a file that should should be read when adding that runtime parameter to the simulation environment. (default is '&')

echo_parameters

Print the runtime parameters after setting them up (defaults to TRUE)

save_to

Filename for saving the runtime parameters to R binary file for later processing or archiving (optional)

Details

This function reads a file containing the runtime parameters required by the CT platform. The variables required depend somewhat upon the exact model implementation (i.e., what CT functions are called, using what methods, and in what order). These should be specified by the model developer. Note that it is possible to call this function twice in order to set default parameters the first time through, and scenario-specific parameters the second time. In that case the default parameters are overwritten if also defined in the scenario-specific parameters file. This enables the latter to only contain parameter values that differ from one model run to the next, rather than repeating standard parameters that rarely change, if ever, between different simulations.

It is important to note that all of the parameters are treated as strings in plaintext (java) formatted files, whereas the class can be explicitly set in XML or JSON files. However, the latter are not yet implemented (and will not be until needed). Thus, it is incumbent upon the user to cast the runtime parameters to correct class before evaluating or manipulating them in their code.

Examples

1
2
3
get_runtime_parameters("/Models/swim25/run81/t0/swim.properties")
get_runtime_parameters("/Models/swim25/run91/t25/swim.properties",
  save_to = "ct_runtime_parameters.RData")

pbsag/swimctr documentation built on May 24, 2019, 10:38 p.m.