Skip to contents

Building stock-and-flow models

as.data.frame(<simulate_stockflow>)
Create data frame of simulation results
as.data.frame(<stockflow>)
Convert stock-and-flow model to data frame
auxiliary() aux()
Add or modify auxiliaries
change_name()
Change name of variable
change_type()
Change variable type
compare_models()
Compare two stock-and-flow models
constant()
Add or modify constants
custom_func()
Create or modify custom variables or functions
dependencies()
Find dependencies
discard()
Remove variable(s)
flow()
Add or modify flows
lookup()
Add or modify lookup variables (graphical functions)
meta()
Modify meta of stock-and-flow model
plot(<stockflow>)
Plot stock-and-flow diagram
print(<compare_stockflow>)
Print comparison of two stock-and-flow models
print(<simulate_stockflow>)
Print simulation of a stock-and-flow model
print(<stockflow>)
Print overview of stock-and-flow model
print(<summary_stockflow>)
Print method for summary_stockflow
stock()
Add or modify stocks
stockflow()
Create a new stock-and-flow model
summary(<stockflow>)
Run model diagnostics
update(<stockflow>)
Create or modify variables

Simulate stock-and-flow models

head(<simulate_stockflow>)
Print first rows of a simulation
plot(<simulate_stockflow>)
Plot timeseries of simulation
sim_methods()
Translate between deSolve and DifferentialEquations.jl solver names
sim_settings()
Modify simulation specifications
simulate(<stockflow>)
Simulate stock-and-flow model
summary(<simulate_stockflow>)
Summarize simulation results
tail(<simulate_stockflow>)
Print last rows of a simulation

Ensemble simulations

as.data.frame(<ensemble_stockflow>)
Create data frame of simulation results
ensemble()
Run ensemble simulation
plot(<ensemble_stockflow>)
Plot timeseries of ensemble simulation

Unit testing

as.data.frame(<verify_stockflow>)
Convert verify() results to a data frame
discard_unit_test()
Remove a unit test from a stock-and-flow model
head(<verify_stockflow>)
Print first rows of verify results
plot(<verify_stockflow>)
Plot verify results
tail(<verify_stockflow>)
Print last rows of verify results
unit_test()
Add or modify unit tests
unit_tests()
Display unit tests defined on a stock-and-flow model
verify()
Verify model behavior with unit tests
verify(<stockflow>)
Verify unit tests against simulation results

Set-up and use Julia

install_julia_env()
Install, update, or remove Julia environment
use_julia()
Start Julia and activate environment

Importing and exporting models

export_model()
Export a stock-and-flow model
import_desolve()
Import a deSolve model
import_insightmaker()
Import Insight Maker model
insightmaker_to_json()
Convert .InsightMaker file to .json file
url_to_insightmaker()
Extract Insight Maker model from URL

Input functions

pulse()
Create pulse function
ramp()
Create ramp function
seasonal()
Create a seasonal wave function
step()
Create step function

Convenience functions

contains_IM()
Check whether value is in vector or string
expit()
Expit function
export_plot()
Save plot to a file
hill()
Hill function
indexof()
Find index of value in vector or string
length_IM()
Length of vector or string
logistic() sigmoid()
Logistic function
logit()
Logit function
rbool()
Generate random logical value
rdist()
Generate random number from custom distribution
rem() mod() `%REM%`
Remainder and modulus
ricker()
Generalized Ricker function
round_IM()
Round values half-up (as in Insight Maker)

Internal functions

clean_name()
Clean variable name(s)
has_internet()
Check if user has internet
nonnegative()
Check whether x is less than zero
saveat_func()
Internal function to save data frame at specific times