% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulation-spades.R
\name{doEvent}
\alias{doEvent}
\title{Process a simulation event}
\usage{
doEvent(
  sim,
  debug = FALSE,
  notOlderThan,
  useFuture = getOption("spades.futureEvents", FALSE),
  events = NULL,
  ...
)
}
\arguments{
\item{sim}{Character string for the \code{simList} simulation object.}

\item{debug}{Optional tools for invoking debugging. Supplying a \code{list}
will invoke the more powerful \code{logging} package. See details.
Default is to use the value in \code{getOption("spades.debug")}.}

\item{notOlderThan}{Date or time. Passed to \code{reproducible::Cache} to update the cache.
Default is \code{NULL}, meaning don't update the cache.
If \code{Sys.time()} is provided, then it will force a recache,
i.e., remove old value and replace with new value.
Ignored if \code{cache} is \code{FALSE}.}

\item{useFuture}{Experimental use of future::future package. Not fully implemented.}

\item{events}{A character vector or a named list of character vectors. If specified,
the simulations will only do the events indicated here. If a named list, the names
must correspond to the modules and the character vectors can be specific events within
each of the named modules. With the \code{list} form, all unspecified modules
will run \emph{all} their events, including internal spades modules, e.g., \code{save},
that get invoked with the \code{outputs} argument in  \code{simInit}. However, if NOT a named list
internal spades modules' events will not run, if not listed in the character vector.
See example.}

\item{...}{Any. Can be used to make a unique cache identity, such as "replicate = 1".
This will be included in the \code{Cache} call, so will be unique
and thus \code{spades} will not use a cached copy as long as
anything passed in \code{...} is unique, i.e., not cached previously.}
}
\value{
Returns the modified \code{simList} object.
}
\description{
Internal function called from \code{spades}.
}
\details{
Calls the module corresponding to the event call, and executes the event.

Here, we implement a simulation in a more modular fashion so it's easier to add
submodules to the simulation. We use S4 classes and methods.
}
\references{
Matloff, N. (2011). The Art of R Programming (ch. 7.8.3).
San Francisco, CA: No Starch Press, Inc. ISBN 978-1-59327-384-2.
}
\author{
Alex Chubaty
}
\keyword{internal}
