Runs the model. Auto-initializes if no session is active.
run.RdRuns the model. Auto-initializes if no session is active.
Usage
run(
max_n_agents = NULL,
input = NULL,
settings = NULL,
auto_terminate = FALSE,
seed = NULL,
jurisdiction = "canada"
)Arguments
- max_n_agents
maximum number of agents
- input
customized input criteria
- settings
customized settings (only used if auto-initializing)
- auto_terminate
whether to automatically terminate session after run (default: FALSE)
- seed
Random seed for reproducibility (optional). If provided, ensures identical results across runs
- jurisdiction
character string specifying the jurisdiction ("canada" or "us"). Default is "canada"
Examples
if (FALSE) { # \dontrun{
# Simple usage - everything handled automatically
results <- run()
# Or with custom input
input <- get_input(jurisdiction = "us", time_horizon = 10)
results <- run(input = input$values)
# Advanced: manual session management for multiple runs
init_session()
run()
run() # run again with same session
terminate_session()
# With reproducible results
run(seed = 123)
} # }