| xmile | R Documentation |
Initialize a stock-and-flow model of class sdbuildR_xmile. You can
either create an empty stock-and-flow model or load a template from the model
library.
xmile(name = NULL)
name |
Name of the template to load. If
|
Do not edit the object manually; this will likely lead to errors downstream.
Rather, use header(), sim_specs(), build(), macro(), and
model_units() for safe manipulation.
A stock-and-flow model object of class sdbuildR_xmile. Its structure is based
on XML Interchange Language for System Dynamics (XMILE). It is a nested list, containing:
Meta-information about model. A list containing arguments listed in header().
Simulation specifications. A list containing arguments listed in sim_specs().
Model variables, grouped under the variable types stock, flow, aux (auxiliaries), constant, and gf (graphical functions). Each variable contains arguments as listed in build().
Global variable or functions. A list containing arguments listed in macro().
Custom model units. A list containing arguments listed in model_units().
Use summary() to summarize, as.data.frame() to convert to a data.frame, plot() to visualize.
build(), header(), macro(), model_units(), sim_specs()
sfm <- xmile()
summary(sfm)
# Load a template
sfm <- xmile("Lorenz")
sim <- simulate(sfm)
plot(sim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.