Loads an experiment from a .gaml
file and returns an object of class
experiment
.
load_experiment(exp, model)
exp | The name of the experiment to load. |
---|---|
model | The name of the GAML file from which to load the experiment. |
The rama
package contains an internal collection of GAMA models. These
models are specified, at minima, by a .gaml
. Additional files such as
shapefile can be used to specify a model, in which case they are in the same
directory as the .gaml
file. The internal collection of GAMA models is
in the examples
directory of the rama
package file hierarchy.
These models can be accessed with the system.file
function as explained in the example.
Before using the package rama
, we advice the user to validate their
model in Gama Platform.
# Listing the models available in the "examples" directory of the "rama" library: grep(".gaml", dir(system.file("models", package = "rama")), value = TRUE)#> [1] "CopyOfsir.gaml" "sir.gaml"# Loading experiment "sir" from the "sir.gaml" file: exp1 <- load_experiment("sir", system.file("models", "sir.gaml", package = "rama"))#> Loading experiment "sir" from file "sir.gaml"...#>#> Periods of observation ("obsrates") are converted into integers.#>#> Final time step ("tmax") is converted into integer.#>#> Seed is converted into numeric.#>#> Parameters' types are cast according to model definition#>#> [1] "experiment" "tbl_df" "tbl" "data.frame"