Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecr::evaluateFitness fails if package is not loaded #132

Open
be-marc opened this issue Jul 20, 2020 · 1 comment
Open

ecr::evaluateFitness fails if package is not loaded #132

be-marc opened this issue Jul 20, 2020 · 1 comment

Comments

@be-marc
Copy link

be-marc commented Jul 20, 2020

ecr::evaluateFitness fails if package is not loaded

objective_function = function(x) {
  sum(x)
}

ctrl = ecr::initECRControl(fitness.fun = objective_function, n.objectives = 1)

population = ecr::initPopulation(mu = 10, gen.fun = ecr::genBin, n.dim = 4)

fitness = ecr::evaluateFitness(ctrl, population)

> Error in parallelMap(function(x) do.call(fitness.fun, c(list(x), list(...))),  : 
   Level 'ecr.evaluateFitness' not registered

You can fix this by using .onLoad() instead of .onAttach in

ecr2/R/zzz.R

Line 17 in 53adbfb

.onAttach = function(libname, pkgname) {

With greetings from Michel

@jakobbossek
Copy link
Owner

Hi Marc,

thanks for the report. We already figured this one out in #130. Going to fix this soon.

Cheers,
Jakob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants