Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
plietar committed Feb 27, 2024
1 parent 3fb1d40 commit 3bfc68d
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ CorrelationParameters <- R6::R6Class(
private$.mvnorm
},

#' @description Save the correlation state.
#' @seealso [save_state()]
save_state = function() {
# mvnorm is sampled at random lazily on its first use. We need to save it
# in order to restore the same value when resuming the simulation,
Expand All @@ -126,6 +128,12 @@ CorrelationParameters <- R6::R6Class(
list(mvnorm=private$.mvnorm)
},

#' @description Restore the correlation state.
#' Only the randomly drawn weights are restored. The object needs to be
#' initialized with the same rhos.
#' @param state a previously saved correlation state, as returned by the
#' save_state method.
#' @seealso [restore_state()]
restore_state = function(state) {
private$.mvnorm <- state$mvnorm
}
Expand Down
32 changes: 32 additions & 0 deletions man/CorrelationParameters.Rd

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

34 changes: 34 additions & 0 deletions man/run_resumable_simulation.Rd

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

0 comments on commit 3bfc68d

Please sign in to comment.