Skip to contents

Flames are the best n solutions so far; their number falls as round(n - t (n - 1) / T). Moth i spirals around flame min(i, count): M = D exp(b s) cos(2 pi s) + F, D = |F - M|, s ~ U(r, 1), r from -1 to -2.

Usage

MothFlameOptimizer(f, bounds, b = 1, 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.

b

Spiral shape.

n_pop

Population size.

max_iter

Iterations.

seed

Philox seed.

Value

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

References

Mirjalili, S. (2015). Moth-flame optimization algorithm: a novel nature-inspired heuristic paradigm. Knowledge-Based Systems 89, 228-249.

Examples

MothFlameOptimizer(function(x) sum(x^2), list(c(-5, 5), c(-5, 5)), max_iter = 50)$fun
#> [1] 1.229318e-14