% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simList-accessors.R, R/checkpoint.R
\name{checkpointFile}
\alias{checkpointFile}
\alias{checkpointFile,simList-method}
\alias{checkpointFile<-}
\alias{checkpointFile<-,simList-method}
\alias{checkpointInterval}
\alias{checkpointInterval,simList-method}
\alias{checkpointInterval<-}
\alias{checkpointInterval<-,simList-method}
\alias{doEvent.checkpoint}
\alias{checkpointLoad}
\alias{.checkpointSave}
\title{Simulation checkpoints}
\usage{
checkpointFile(sim)

\S4method{checkpointFile}{simList}(sim)

checkpointFile(sim) <- value

\S4method{checkpointFile}{simList}(sim) <- value

checkpointInterval(sim)

\S4method{checkpointInterval}{simList}(sim)

checkpointInterval(sim) <- value

\S4method{checkpointInterval}{simList}(sim) <- value

doEvent.checkpoint(sim, eventTime, eventType, debug = FALSE)

checkpointLoad(file)

.checkpointSave(sim, file)
}
\arguments{
\item{sim}{A \code{simList} simulation object.}

\item{value}{The parameter value to be set (in the corresponding \code{module} and \code{param}).}

\item{eventTime}{A numeric specifying the time of the next event.}

\item{eventType}{A character string specifying the type of event: one of
either \code{"init"}, \code{"load"}, or \code{"save"}.}

\item{debug}{Optional logical flag determines whether \code{sim} debug info
will be printed (default \code{debug = FALSE}).}

\item{file}{The checkpoint file.}
}
\value{
Returns the modified \code{simList} object.
}
\description{
Save and reload the current state of the simulation,
including the state of the random number generator,
by scheduling checkpoint events.
}
\note{
Checkpoint files are intended to be used locally, and do not invoke
the simulation archiving tools to bundle and subsequently extract simulation
files (e.g., file-backed rasters).

RNG save code adapted from:
\url{http://www.cookbook-r.com/Numbers/Saving_the_state_of_the_random_number_generator/}
and \url{https://stackoverflow.com/q/13997444/1380598}
}
\seealso{
\link{.Random.seed}.

Other functions to access elements of a 'simList' object:
\code{\link[=.addDepends]{.addDepends()}},
\code{\link[=envir]{envir()}},
\code{\link[=events]{events()}},
\code{\link[=globals]{globals()}},
\code{\link[=inputs]{inputs()}},
\code{\link[=modules]{modules()}},
\code{\link[=objs]{objs()}},
\code{\link[=packages]{packages()}},
\code{\link[=params]{params()}},
\code{\link[=paths]{paths()}},
\code{\link[=progressInterval]{progressInterval()}},
\code{\link[=times]{times()}}
}
\author{
Alex Chubaty
}
\concept{functions to access elements of a 'simList' object}
