Skip to contents

With r1 = a - t a / T, each coordinate moves x + r1 sin(r2) |r3 P - x| when r4 < 1/2 and with cos(r2) otherwise; r2 ~ U(0, 2 pi), r3 ~ U(0, 2).

Usage

SineCosineAlgorithm(f, bounds, a = 2, 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.

a

Initial r1.

n_pop

Population size.

max_iter

Iterations.

seed

Philox seed.

Value

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

References

Mirjalili, S. (2016). SCA: a sine cosine algorithm for solving optimization problems. Knowledge-Based Systems 96, 120-133.

Examples

SineCosineAlgorithm(function(x) sum(x^2), list(c(-5, 5), c(-5, 5)), max_iter = 50)$fun
#> [1] 5.101738e-10