sens_apsim {apsimx}R Documentation

Sensitivity Analysis for APSIM Next Generation simulation

Description

It is a wrapper for running APSIM and evaluating different parameters values

Usage

sens_apsim(
  file,
  src.dir = ".",
  crop.file,
  parm.paths,
  parm.vector.index,
  xml.parm,
  grid,
  summary = c("mean", "max", "var", "sd", "none"),
  root,
  verbose = TRUE,
  cores = 1L,
  save,
  ...
)

Arguments

file

file name to be run (with extension .apsim)

src.dir

directory containing the .apsim file to be run (defaults to the current directory)

crop.file

name of auxiliary xml file where parameters are stored. If this is missing, it is assumed that the parameters to be edited are in the main simulation file.

parm.paths

absolute or relative paths of the coefficients to be evaluated. It is recommended that you use inspect_apsim for this

parm.vector.index

Index to evaluate a specific element of a parameter vector. At the moment it is possible to only edit one element at a time. This is because there is a conflict when generating multiple elements in the candidate vector for the same parameter.

xml.parm

TRUE or FALSE for each parameter. Indicating whether it is part of an xml file. Its length should be equal to the length or ‘parm.paths’.

grid

grid of parameter values for the evaluation. It can be a data.frame.

summary

function name to use to summarize the output to be a sinlge row (default is the mean).

root

root argument for edit_apsim

verbose

whether to print progress in percent and elapsed time.

cores

number of cores to use for parallel evaluation

save

whether to save intermediate results. By default they will be saved as a ‘csv’ file using the name of the apsim file. This will replace ‘apsim’ with ‘csv’. It is also possible to provide the file name here (for example: ‘Some_results.csv’).

...

additional arguments (none used at the moment).

Value

object of class ‘sens_apsim’, but really just a list with results from the evaluations.

Note

The summary function is stored as an attribute of the data frame ‘grid.sims’.

Examples


## See the vignette for examples



[Package apsimx version 2.7.7 Index]