Recall the LCC2005
module we examined in exercise 4. What is different about this module compared to, e.g., the forestAge
module? Hint: examine the module structure (metadata, events, functions, and .inputObjects
sections).
module.path <- file.path(dirname(tempdir()), "modules")
downloadModule("LCC2005", module.path)
openModules(c("LCC2005", "forestAge"), module.path)
Identify the child modules used by this parent module.
Examine the directory structure of the parent and child modules. How do they differ?
Visually examine the data dependency relationships between these modules.
setPaths(modulePath = module.path)
times <- list(start = 2005.0, end = 2020.0, timeunit = "year")
parameters <- list(
.globals = list(burnStats = "fireStats"),
fireSpreadLcc = list(drought = 1.2),
caribouMovementLcc = list(
N = 1e3,
startTime = times$start + 1,
glmInitialTime = NA_real_)
)
modules <- list("LCC2005")
lcc05 <- simInit(times = times, modules = modules, params = parameters)
moduleDiagram(lcc05)
objectDiagram(lcc05)
Visually inspect the completed events list:
eventDiagram(lcc05)
Uh oh! The simulation has been initialized, but it hasn’t yet been run so the completed events list is empty!
Run the simulation and re-inspect (visually) the completed events list:
lcc05_out <- spades(Copy(lcc05))
eventDiagram(lcc05_out)
Recall from exercise 4:
Create a simple module that does one of the following:
generates a random map (hint: see
?gaussMap
) and updates the values in the raster cells;model population dynamics as subpopulations within each raster cell.
Now it’s time to build the other module you didn’t build earlier.
Create a new parent module that will link these two modules together.