About runs
A run is what happens when the users of your app play a game. The model gets loaded into memory. The model variables can be accessed from and saved to memory and operations can be called on the model.
The values of the model variables and a log of the executed operations can be saved to the database. The saved variable values and the operation log can be used to restore the run when users reconnect.
Access model variables
There are two ways you can access variables for a run:
- During a run, the model variable values can be accessed from memory.
- If you save variables to the database, you can access the saved values without restoring the run and loading the model into memory.
For details on accessing variables, please see language-specific model reference pages.
Save variables to database
Saving the variable values to the database provides for a fast way to display data for multiple runs. For example, to display summaries of multiple runs on a facilitator page.
The method you use to store variable values to the database depends on the language your model is created in:
- Modeling languages: For models created with tools such as Excel, SimLang, or Vensim, update the
variablesobject in your model context file by adding"save": truefor each variable that needs to be saved. - Programming languages: For models written in languages such as Java or Python, call the function
Epicenter.record()as in this example.
To learn more about runs, read this article in the Developer concepts.