Skip to content

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

@be-marc

Description

@be-marc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions