Generates a param.sti file and sets code optim in new_travail.usm to force parameters values in STICS simulations (this function is typically called before SticsOnR::run_stics())

force_param_values(workspace, values, javastics, force = FALSE)

Arguments

workspace

Path of the workspace containing the STICS (txt) input files.

values

named vector of parameter values to force. See Details for more information.

javastics

Path of JavaSTICS

force

Logical, if TRUE, unknown parameter names only trigger a warning and are still written to param.sti. If FALSE (default), unknown parameter names trigger an error.

Value

A logical status TRUE if successful, FALSE otherwise

Details

This function operates on STICS text input files. Do not use it before calling gen_usms_xml2txt(), otherwise param.sti and new_travail.usm files will be overwritten.

This function has been created to be called before SticsOnR::run_stics(). It can not work with SticsOnR::run_javastics(), that will overwrite param.sti and new_travail.usm files.

values can contain NA. In this case, the corresponding parameter(s) will not be forced (default value(s), i.e. read in STICS input files, will be used). If values==NA or values==NULL, not any parameter will be forced (all default values used).

See also

SticsOnR::run_stics()

Examples

if (FALSE) { # \dontrun{
example_txt_dir <- get_examples_path(file_type = "txt")
force_param_values(example_txt_dir,
  setNames(object = c(220, 330), c("stlevamf", "stamflax")),
  javastics = "/path/to/javastics"
)
} # }