Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
plietar committed Mar 25, 2024
1 parent 1e376b9 commit a5fc679
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
18 changes: 12 additions & 6 deletions R/simulation.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,20 @@ save_object_state <- function(objects) {

#' @title Restore the simulation state
#' @description Restore the simulation state from a previous checkpoint.
#' The state of passed events and variables is overwritten to match the state they
#' had when the simulation was checkpointed. Returns the time step at which the
#' simulation should resume.
#' @param state the simulation state to restore, as returned by \code{\link[individual]{restore_state}}.
#' The state of passed events and variables is overwritten to match the state
#' they had when the simulation was checkpointed.
#' @param state the simulation state to restore, as returned by
#' \code{\link[individual]{restore_simulation_state}}.
#' @param variables the list of Variables
#' @param events the list of Events
#' @param restore_random_state if TRUE, restore R's global random number generator's state from the checkpoint.
restore_simulation_state <- function(state, variables, events, restore_random_state) {
#' @param restore_random_state if TRUE, restore R's global random number
#' generator's state from the checkpoint.
#' @return the time step at which the simulation should resume.
restore_simulation_state <- function(
state,
variables,
events,
restore_random_state) {
timesteps <- state$timesteps + 1

restore_object_state(timesteps, variables, state$variables)
Expand Down
2 changes: 2 additions & 0 deletions man/Event.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/TargetedEvent.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions man/restore_simulation_state.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a5fc679

Please sign in to comment.