Learn R Programming

adagio (version 0.5.9)

simpleEA: Simple Evolutionary Algorithm

Description

Simple Evolutionary Algorithm for Minimization.

Usage

simpleEA(fn, lower, upper, N = 100, ..., con = 0.1, new = 0.05,
         tol = 1e-10, eps = 1e-07, scl = 1/2, confined = FALSE, log = FALSE)

Arguments

fn
the objective function to be minimized.
lower
vector of lower bounds for all coordinates.
upper
vector of upper bounds for all coordinates.
N
number of children per parent.
...
additional parameters to be passed to the function.
con
percentage of individuals concentrating to the best parents.
new
percentage of new individuals not focussed on existing parents.
tol
tolerance; if in the last three loops no better individuals were found up to this tolerance, stop.
eps
grid size bound to be reached.
scl
scaling factor for shrinking the grid.
confined
logical; shall the set of individuals be strictly respect the boundary? Default: FALSE.
log
logical, should best solution found be printed per step.

Value

  • List with the following components:
  • parnumeric vector representing the minimum found.
  • valfunction value at the minimum found.
  • fun.callsnumber of function calls made.
  • rel.scllast scaling factor indicating grid size in last step.
  • rel.tolrelative tolerance within the last three minima found.

Details

Evolutionary search to minimize a function: For each point in the current generation, n random points are introduced and the n best results of each generation (and its parents) are used to form the next generation.

The scale shrinks the generation of new points as the algorithm proceeds. It is possible for some children to lie outside the given rectangle, and therefore the final result may lie outside the unit rectangle well. (TO DO: Make this an option.)

References

Stan Wagon. ``Think Globally, Act Locally". Chapter 4 In: F. Bornemann, D. Laurie, S. Wagon, and J. Waldvogel (Eds.). The SIAM 100-Digit Challenge. Society of Industrial and Applied Mathematics, 2004.

See Also

DEoptim in the `DEoptim' package.

Examples

Run this code
simpleEA(trefethen, lower=c(-1,-1), upper=c(1,1), log=FALSE)
  # $par
  # [1] -0.02440310  0.21061243  # this is the true global optimum!
  # $val
  # [1] -3.306869

Run the code above in your browser using DataLab