Skip to content

Commit

Permalink
Rename indices to parent_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmbaazam authored and sbfnk committed Jan 30, 2024
1 parent f2626c9 commit 835252f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R/simulate.r
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,13 @@ simulate_summary <- function(index_cases,
susc_pop = susc_pop
)
}

## record indices corresponding to the number of offspring
indices <- rep(sim, n_offspring[sim])
## record parent_ids corresponding to the number of offspring
parent_ids <- rep(sim, n_offspring[sim])

## initialise number of offspring
n_offspring <- rep(0, index_cases)
## assign offspring sum to indices still being simulated
n_offspring[sim] <- tapply(next_gen, indices, sum)
## assign offspring sum to parents still being simulated
n_offspring[sim] <- tapply(next_gen, parent_ids, sum)

# track size/length
stat_track <- update_chain_stat(
Expand Down

0 comments on commit 835252f

Please sign in to comment.