metaRangeEnvironment | R Documentation |
Creates an metaRangeEnvironment object in form of an R6 class that stores and handles the environmental values that influence the species in the simulation.
An <metaRangeEnvironment>
object
sourceSDS
A SpatRasterDataset created by terra::sds()
that holds all the environmental values influencing the simulation.
Note that the individual data sets should be sensibly named as
their names will used throughout the simulation to refer to them.
current
an R environment that holds all the environmental values influencing the present time step of the simulation as regular 2D R matrices.
new()
Creates a new metaRangeEnvironment object. This is done automatically when a simulation is created. No need to call this as user.
metaRangeEnvironment$new(sourceSDS = NULL)
sourceSDS
<SpatRasterDataset>
created by terra::sds()
that holds all the environmental values influencing the simulation.
Note that the individual data sets should be sensibly named as
their names will used throughout the simulation to refer to them.
An <metaRangeEnvironment>
object
# Note: Only for illustration purposes. env <- metaRangeEnvironment$new(sourceSDS = terra::sds(terra::rast(vals = 1, nrow = 2, ncol = 2))) env
set_current()
Set current (active) time step / environment. No reason to call this as user. The current time step is set automatically.
metaRangeEnvironment$set_current(layer)
layer
<integer>
layer
<invisible self>
# Only for illustration purposes. sim_env <- terra::sds(terra::rast(vals = 1, nrow = 2, ncol = 2, nlyr = 2)) names(sim_env) <- "env_01" env <- metaRangeEnvironment$new(sourceSDS = sim_env) env$set_current(layer = 1)
print()
Prints information about the environment to the console
metaRangeEnvironment$print()
<invisible self>
env <- metaRangeEnvironment$new( sourceSDS = terra::sds(terra::rast(vals = 1, nrow = 2, ncol = 2, nlyr = 2)) ) env$print()
## ------------------------------------------------
## Method `metaRangeEnvironment$new`
## ------------------------------------------------
# Note: Only for illustration purposes.
env <- metaRangeEnvironment$new(sourceSDS = terra::sds(terra::rast(vals = 1, nrow = 2, ncol = 2)))
env
## ------------------------------------------------
## Method `metaRangeEnvironment$set_current`
## ------------------------------------------------
# Only for illustration purposes.
sim_env <- terra::sds(terra::rast(vals = 1, nrow = 2, ncol = 2, nlyr = 2))
names(sim_env) <- "env_01"
env <- metaRangeEnvironment$new(sourceSDS = sim_env)
env$set_current(layer = 1)
## ------------------------------------------------
## Method `metaRangeEnvironment$print`
## ------------------------------------------------
env <- metaRangeEnvironment$new(
sourceSDS = terra::sds(terra::rast(vals = 1, nrow = 2, ncol = 2, nlyr = 2))
)
env$print()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.