Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions R/engine_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,28 @@
#' engine_eval(~ check_finite(1/0)) ## returns nothing and throws an error
#' ```
#'
#' ## Control Flow
#'
#' Functions for controlling the flow of simulations.
#'
#' ### Functions
#'
#' * `stop_if_lt(x, y)` : Stop the simulation loop and return
#' simulations if any element of `x` is less than the
#' corresponding element in `y`. The elements of `y` are
#' recycled to match those in `x` if necessary and if possible.
#'
#' ### Arguments
#'
#' * `x` : Matrix to compare with `y`.
#' * `y` : Matrix to compare with `x`, with a default value of
#' `0`.
#'
#' ### Return
#'
#' An empty matrix. This function is returned for its effect of
#' breaking out of the simulation loop.
#'
#' ## Assign (deprecated)
#'
#' Assign values to a subset of the elements in a matrix.
Expand Down Expand Up @@ -1056,6 +1078,7 @@
#' @aliases pnorm
#' @aliases invlogit
#' @aliases logit
#' @aliases stop_if_lt
#' @aliases cumsum
#' @aliases assign
#' @aliases unpack
Expand Down
1 change: 1 addition & 0 deletions R/enum.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ valid_func_sigs = c(
, "fwrap: pnorm(q, mean, sd)"
, "fwrap: invlogit(x)"
, "fwrap: logit(x)"
, "fwrap: stop_if_lt(x, y)"
, "fwrap: cumsum(x)"
, "fwrap: assign(x, i, j, v)"
, "fwrap: unpack(x, ...)"
Expand Down
1 change: 1 addition & 0 deletions R/mp_tmb_model_spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ TMBModelSpec = function(
self$update_method$before()
, self$update_method$during()
, self$update_method$after()
, .simulate_exprs = self$sim_exprs
)
}

Expand Down
4 changes: 2 additions & 2 deletions inst/starter_models/nfds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,14 @@ start_time <- Sys.time()
old_sim = mp_simulator(old_spec,time_steps = 1L,outputs = "Y")
end_time <- Sys.time()
end_time - start_time
#> Time difference of 0.2173371 secs
#> Time difference of 0.195493 secs

# new spec
start_time <- Sys.time()
new_sim = mp_simulator(new_spec,time_steps = 1L,outputs = "Y")
end_time <- Sys.time()
end_time - start_time
#> Time difference of 0.222172 secs
#> Time difference of 0.187727 secs
```

Creating a simulator with one time step results in the new model
Expand Down
29 changes: 29 additions & 0 deletions man/engine_functions.Rd

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

Loading