ecr2
ecr2 copied to clipboard
ecr::evaluateFitness fails if package is not loaded
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 https://github.com/jakobbossek/ecr2/blob/53adbfb50253ceaeecd4af7d3bba106add092950/R/zzz.R#L17
With greetings from Michel
Hi Marc,
thanks for the report. We already figured this one out in #130. Going to fix this soon.
Cheers, Jakob