-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
There are a few places in where could make data objects more user friendly, e.g. with the iterative simulation below. Maybe the array could have named dimensions to avoid having to rely on numeric indexing later on? Could also explore use of Map or similar to streamline these loops (e.g. as in {finalsize} vignettes).
# Create an array to contain outputs after looping the model.
# Array contains XX rows = Total S, E, I, R (4), and
# in each age compartment (XX) as well as the cumulative incidence (XX)
x <- array(NA, dim = c(seird_age_model$info()$len, 1, n_steps+1))
# For loop to run the model iteratively
x[ , ,1] <- seird_age_model$state()
for (t in seq_len(n_steps)) {
x[ , ,t+1] <- seird_age_model$run(t)
}It may depend a bit on how odin.dust is structured, but also wondered if it was possible to reduce reliance on numeric indexing in the state variables, e.g. in this line of code?
Metadata
Metadata
Assignees
Labels
No labels