ModvegeEnvironment | R Documentation |
Data structure that contains inputs (parameters pertaining to a site, to the vegetation, to the weather and to the management) to growR simulations.
This class contains site parameters, weather and management data for one simulation run of growR on a given site over several years. Methods are provided to allow access to relevant data for a given year.
All inputs are read in from data files through the respective data classes
WeatherData, ManagementData and ModvegeParameters. These parameters
can be simultaneously specified through a config file using read_config()
.
site_name
Name of site to be simulated.
run_name
Name of simulation run. Allows distinguishing between different simulations at the same site. Defaults to "-" for no name.
run_name_in_filename
How the run name will be represented in an
output file. If run_name
is the default "-", indicating no name, this
will be an empty string. Otherwise, it will be the run_name
prepended
by and underscore _
.
years
Years for which environment data (weather & management) is present.
param_file
Name of supplied parameter file.
weather_file
Name of supplied weather file.
management_file
Name of supplied management file.
parameters
A ModvegeParameters object.
weather
A WeatherData object.
management
A ManagementData object.
input_dir
Directory in which parameter, weather and management files are searched for. Defaults to 'getOption("growR.input_dir").
new()
Instantiate a new ModvegeEnvironment
ModvegeEnvironment$new( site_name, run_name = "-", years = NULL, param_file = "-", weather_file = "-", management_file = "-", input_dir = NULL )
site_name
string Name of the simulated site.
run_name
string Name of the simulation run. Used to differentiate between different simulation conditions at the same site. Defaults to "-", which indicates no specific run name.
years
numeric Vector of integer years to be simulated.
param_file
string Name of file that contains site and
vegetation parameters. If default value "-"
is provided, it is
assumed to be "SITENAME_parameters.csv".
weather_file
string Analogous to param_file.
management_file
string Analogous to param_file.
input_dir
string Path to directory containing input files.
Defaults to getOption("growR.input_dir")
.
set_run_name()
Set run name and update run_name_in_filename.
ModvegeEnvironment$set_run_name(run_name)
run_name
Str. New value of self$run_name
.
load_inputs()
Load simulation inputs.
Stores parameters, management and weather data from files specified in self$parameter_file, self$weather_file and self$management_file, respectively.
ModvegeEnvironment$load_inputs()
make_filename_for_run()
Ensure a readable filename for given run_name.
ModvegeEnvironment$make_filename_for_run(run_name)
run_name
Name of run to be converted into a filename.
A version of run_name that can be used in a filename.
get_environment_for_year()
Get weather and environment for given year
Convenience function to retrieve environmental and management
inputs for given year from multi-year data containers self$weather
and self$management
.
ModvegeEnvironment$get_environment_for_year(year)
year
int; year for which to extract data.
list(W, M)
where W
is the WeatherData and M
the
ManagementData object for given year.
clone()
The objects of this class are cloneable with this method.
ModvegeEnvironment$clone(deep = FALSE)
deep
Whether to make a deep clone.
read_config()
WeatherData$get_weather_for_year()
,
ManagementData$get_management_for_year()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.