Skip to content

Commit

Permalink
fix smoof_example.R and monitor docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobbossek committed Sep 27, 2016
1 parent 511d77b commit 8b53352
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions R/makeMonitor.R
Expand Up @@ -4,8 +4,8 @@
#' @description
#' Monitor objects serve for monitoring the optimization process. Each monitor
#' object expects the parameters \code{before}, \code{step} and \code{after},
#' each being a function and expecting \code{envir = parent.frame()} as the
#' only parameter. This way one can access all the variables used within the
#' each being a function and expecting \code{opt.state} and \code{...} as the
#' only parameters. This way one can access all the variables used within the
#' evolutionary cycle.
#'
#' @param before [\code{function}]\cr
Expand Down
8 changes: 4 additions & 4 deletions inst/examples/smoof_example.R
Expand Up @@ -18,10 +18,10 @@ load_all(".", reset = TRUE)

# Monitoring function. For details on the expected formal parameters
# see the help pages for makeMonitor and setupConsoleMonitor.
myMonitorStep = function(envir = parent.frame()) {
n.targets = envir$control$n.targets
population = envir$opt.state$population
task = envir$opt.state$task
myMonitorStep = function(opt.state, ...) {
n.targets = opt.state$control$n.targets
population = opt.state$population
task = opt.state$task

x = seq(-5, 5, by = 0.05)
df = data.frame(x = x, y = sapply(x, task$fitness.fun))
Expand Down
4 changes: 2 additions & 2 deletions man/makeMonitor.Rd

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

0 comments on commit 8b53352

Please sign in to comment.