diff --git a/.travis.yml b/.travis.yml index 67352fe..a589949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ os: r_github_packages: - jimhester/covr - - jakobbossek/smoof after_success: - Rscript -e 'library(covr);coveralls()' diff --git a/DESCRIPTION b/DESCRIPTION index a0c1a6c..3e37704 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,8 +3,8 @@ Type: Package Title: Covariance Matrix Adaptation Evolution Strategy Description: Pure R implementation of the Covariance Matrix Adaptation - Evolution Strategy (CMA-ES) with optional restarts (IPOP-CMA-ES). -Version: 1.0.1 -Date: 2016-01-18 +Version: 1.0.2 +Date: 2016-08-03 Authors@R: c(person("Jakob", "Bossek", email = "j.bossek@gmail.com", role = c("aut", "cre"))) Maintainer: Jakob Bossek @@ -12,10 +12,10 @@ URL: https://github.com/jakobbossek/cmaesr BugReports: https://github.com/jakobbossek/cmaesr/issues License: BSD_2_clause + file LICENSE Depends: - ParamHelpers (>= 1.3), + ParamHelpers (>= 1.8), BBmisc (>= 1.6), checkmate (>= 1.1), - smoof (>= 1.1) + smoof (>= 1.4) Imports: ggplot2 Suggests: diff --git a/R/cmaes.R b/R/cmaes.R index 685996a..c5bbd42 100644 --- a/R/cmaes.R +++ b/R/cmaes.R @@ -101,7 +101,7 @@ cmaes = function( assertClass(objective.fun, "smoof_function") # extract relevant data - par.set = getParamSet(objective.fun) + par.set = ParamHelpers::getParamSet(objective.fun) lb = getLower(par.set); ub = getUpper(par.set) n = getNumberOfParameters(objective.fun) @@ -144,6 +144,8 @@ cmaes = function( # restart mechanism (IPOP-CMA-ES) restart.triggers = getCMAESParameter(control, "restart.triggers", character(0L)) stop.ons.names = sapply(stop.ons, function(stop.on) stop.on$code) + print(stop.ons.names) + print(restart.triggers) if (!isSubset(restart.triggers, stop.ons.names)) { stopf("Only codes / short names of active stopping conditions allowed as restart trigger, but '%s' are no stopping conditions.", collapse(setdiff(restart.triggers, stop.ons.names), sep = ", ")) } diff --git a/tests/testthat/test_cmaes.R b/tests/testthat/test_cmaes.R index 75b33e7..3e012f8 100644 --- a/tests/testthat/test_cmaes.R +++ b/tests/testthat/test_cmaes.R @@ -14,7 +14,7 @@ test_that("CMA-ES finds optimum of some BBOB functions", { for (generator in fun.generators) { for (dim in dims) { fn = do.call(generator, list(dim)) - par.set = getParamSet(fn) + par.set = ParamHelpers::getParamSet(fn) opt = getGlobalOptimum(fn) lb = getLower(par.set)[1L]; ub = getUpper(par.set)[1L] @@ -119,7 +119,7 @@ test_that("CMA-ES computes reasonanable results on noiseless 2D BBOB test set", } lambda2 = ifelse (fid %in% c(4, 5, 16, 23, 24), lambda * 4, lambda) fn = makeBBOBFunction(fid = fid, iid = 1L, dimension = dim) - par.set = getParamSet(fn) + par.set = ParamHelpers::getParamSet(fn) opt = getGlobalOptimum(fn) lb = getLower(par.set)[1L]; ub = getUpper(par.set)[1L] control = list( @@ -148,7 +148,7 @@ test_that("IPOP-CMA-ES works", { max.iters = 5000L fn = makeAckleyFunction(2L) - par.set = getParamSet(fn) + par.set = ParamHelpers::getParamSet(fn) lb = getLower(par.set); ub = getUpper(par.set) control = list( sigma = (ub[1L] - lb[1L]) / 2,