ecr | R Documentation |
The most flexible way to setup evolutionary algorithms with ecr is by
explicitely writing the evolutionary loop utilizing various ecr utlity functions.
However, in everyday life R users frequently need to optimize a single-objective R function.
The ecr
function thus provides a more R like interface for single
objective optimization similar to the interface of the optim
function.
ecr(
fitness.fun,
minimize = NULL,
n.objectives = NULL,
n.dim = NULL,
lower = NULL,
upper = NULL,
n.bits,
representation,
mu,
lambda,
perm = NULL,
p.recomb = 0.7,
p.mut = 0.3,
survival.strategy = "plus",
n.elite = 0L,
log.stats = list(fitness = list("min", "mean", "max")),
log.pop = FALSE,
monitor = NULL,
initial.solutions = NULL,
parent.selector = NULL,
survival.selector = NULL,
mutator = NULL,
recombinator = NULL,
terminators = list(stopOnIters(100L)),
...
)
fitness.fun |
[ |
minimize |
[ |
n.objectives |
[ |
n.dim |
[ |
lower |
[ |
upper |
[ |
n.bits |
[ |
representation |
[ |
mu |
[ |
lambda |
[ |
perm |
[ |
p.recomb |
[ |
p.mut |
[ |
survival.strategy |
[ |
n.elite |
[ |
log.stats |
[ |
log.pop |
[ |
monitor |
[ |
initial.solutions |
[ |
parent.selector |
[ |
survival.selector |
[ |
mutator |
[ |
recombinator |
[ |
terminators |
[ |
... |
[any] |
[ecr_result
]
fn = function(x) {
sum(x^2)
}
lower = c(-5, -5); upper = c(5, 5)
res = ecr(fn, n.dim = 2L, n.objectives = 1L, lower = lower, upper = lower,
representation = "float", mu = 20L, lambda = 10L,
mutator = setup(mutGauss, lower = lower, upper = upper))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.