Skip to contents

The archive keeps the n_pop best solutions, sorted; each ant picks a guide l with probability proportional to w_l = exp(-(l - 1)^2 / (2 q^2 k^2)) and samples every coordinate from N(s_li, sigma_i^2), sigma_i = xi times the mean absolute distance from s_l to the archive; the archive keeps the best k.

Usage

AntColonyContinuous(
  f,
  bounds,
  n_ants = NULL,
  q = 0.2,
  xi = 0.85,
  n_pop = 20,
  max_iter = 200,
  seed = 0
)

Arguments

f

Objective to minimise.

bounds

List of c(low, high) pairs or a two-column matrix.

n_ants

New solutions per iteration (default n_pop).

q

Locality of the rank weights.

xi

Evaporation rate.

n_pop

Population size.

max_iter

Iterations.

seed

Philox seed.

Value

list(x, fun, estimate, history, n_fev, method).

References

Socha, K. and Dorigo, M. (2008). Ant colony optimization for continuous domains. European Journal of Operational Research 185, 1155-1173.

Examples

AntColonyContinuous(function(x) sum(x^2), list(c(-5, 5), c(-5, 5)), max_iter = 50)$fun
#> [1] 1.369985e-19