Fn <- Historize(fnRastrigin)
dm <- 10
lb <- rep(-5.2, dm); ub <- -lb
# Fn(NULL)
sol <- simpleDE(Fn, lower = lb, upper = ub)
fvalues <- Fn()
fvals <- cummin(fvalues)
if (FALSE) {
plot(fvalues, type = 'p', col = 7, pch = '.', cex = 2,
main = "Simple DE optimization", xlab = '', ylab = '')
lines(fvals, col = 2, lwd = 1)
legend(length(fvalues), max(fvalues),
c("Intermediate values", "cummulated min"),
xjust = 1, col = c(7, 1), lwd = 2)
grid()}
Run the code above in your browser using DataLab