forked from PredictiveEcology/LandWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path11-post-sim.R
More file actions
34 lines (30 loc) · 1.18 KB
/
11-post-sim.R
File metadata and controls
34 lines (30 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
################################################################################
## post-simulation object creation (for documentation)
################################################################################
modules_landweb <- c("LandWeb_preamble", "Biomass_speciesData", modules3)
fsim <- simFile("mySim_landweb", "docs", 0)
mySim_landweb <- if (!file.exists(fsim)) {
Cache(simInit,
times = times3,
params = parameters3,
modules = modules_landweb,
outputs = outputs3,
objects = objects3,
paths = paths3,
loadOrder = unlist(modules_landweb),
omitArgs = c("debug", "paths", ".plotInitialTime")
)
saveRDS(Copy(mySim_landweb), fsim)
} else {
readRDS(fsim)
}
png(file.path("docs", "LandWeb_module_diagram.png"), height = 800, width = 800)
moduleDiagram(mySim_landweb)
dev.off()
## currently not working: see https://github.com/rich-iannone/DiagrammeR/issues/207
## workaround is to use Rstudio's manual export ability :S
objectDiagram(mySim_landweb, height = 2500, width = 1250) # %>%
# DiagrammeRsvg::export_svg() %>%
# charToRaw() %>%
# rsvg::rsvg() %>%
# png::writePNG(file.path("docs", "LandWeb_object_diagram.png"))