R/core.makeTerminator.R

Defines functions makeTerminator

#' @title
#' Generate stopping condition.
#'
#' @description Wrap a function within a stopping condition object.
#'
#' @param condition.fun [\code{function}]\cr
#'   Function which takes a logger object \code{log} (see \code{\link{initLogger}})
#'   and returns a single logical.
#' @param name [\code{character(1)}]\cr
#'   Identifier for the stopping condition.
#' @param message [\code{character(1)}]\cr
#'   Message which should be stored in the termination object, if the stopping
#'   condition is met.
#' @return [\code{ecr_terminator}]
#' @export
makeTerminator = function(name, params, message, fun, setting = c("single", "multi")) {
  EATerminator$new(
    name = name, params = params, message = message, fun = fun, setting = c("single", "multi"))
}
jakobbossek/ecr3 documentation built on Nov. 14, 2019, 7:47 p.m.