knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
This is an experimental package. The R and JSON syntax can still change significantly.
This package allows to read in a JSON object and translate it into a simmer environment. See below for an example definition:
library(simmer.json) my_JSON<-'{ "env": { "resources": { "nurse": { "capacity": 1 } }, "generators": { "patients": { "trajectory": "t1", "dist": "%at(0,0,0)%" } } }, "trajectories": { "t1": [ { "activity": "seize", "resource": "nurse" }, { "activity": "timeout", "task": "%3%" }, { "activity": "release", "resource": "nurse" } ] } } '
You can translate this into simmer using:
library(simmer.json) env<- deserialise(my_JSON) env
And run the environment:
env %>% run()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.