Skip to content

Commit

Permalink
prepend PH prefix to getParamSet, depend on PH>=1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobbossek committed Aug 3, 2016
1 parent 787961d commit fa252f6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -8,7 +8,6 @@ os:

r_github_packages:
- jimhester/covr
- jakobbossek/smoof

after_success:
- Rscript -e 'library(covr);coveralls()'
Expand Down
8 changes: 4 additions & 4 deletions DESCRIPTION
Expand Up @@ -3,19 +3,19 @@ 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 <j.bossek@gmail.com>
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:
Expand Down
4 changes: 3 additions & 1 deletion R/cmaes.R
Expand Up @@ -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)

Expand Down Expand Up @@ -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 = ", "))
}
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test_cmaes.R
Expand Up @@ -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]

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit fa252f6

Please sign in to comment.