# NOT RUN {
# Create a model using the baseline parameters included in the package.
# Note: This initialisation can take a few seconds.
model <- Model.new( params = list( n_total = 10000 ) )
if (!is.null(model)) {
# Begin simulation:
env <- COVID19IBM$new( model )
sim <- Simulation$new( env )
sim$start_simulation()
sim$steps(1) # Note: slow operation (takes a few seconds).
# Make changes to the model (environment)
model$seed_infect_by_idx(0)
# Resume simulation
sim$steps(1) # Note: slow operation (takes a few seconds).
# Get results
sim$results
}
# }
Run the code above in your browser using DataLab