Genetic Algorithm: Langerman Function and Tournament Choice

I am having trouble understanding how to implement the Langermann function and choosing a tournament in my genetic algorithm. I have this as a reference for the Langermann function, but I don’t understand where the value of C comes from, since I only have X and Y. Is the value of C always always a constant set of numbers?

Regarding the choice of the tournament, I want to randomly select any 3 of my population and compare their suitability. As soon as you can generate fitness values ​​using the Langerman function, I will have every fitness value in a vector. Then I want to select 3 unique random elements from a vector and compare them with each other. How do you select 3 unique random elements from a vector without using the same numbers?

Any help is appreciated!

+4
source share
1 answer

Lagerman function

- is the value of C always a constant set of numbers?

The suggested values ​​for m, cand Aare the values ​​indicated by Molga and Smutnicki (2005) .

c - ( /).

(x, y) ∈ [0, 10] x [0, 10]. m , c. , .

, - .

"" :

const double A[5][2] = {{3.0, 5.0},{5.0, 2.0},{2.0, 1.0},{1.0, 4.0},{7.0, 9.0}};
const double c[5] = {1.0, 2.0, 5.0, 2.0, 3.0};
const unsigned d = 2;

double s = 0.0;
for (unsigned j = 0; j < d; ++j)
  s += std::pow(x[j] - A[i][j], 2.0);

:

const double pi = 3.1415926535897932;
const unsigned m = 5;

double ret = 0.0;
for (unsigned i(0); i < m; ++i)
{
  // calculate `s`

  ret += c[i] * std::exp(-s / pi) * std::cos(pi * s);
}

ret .


3 ?

: , , , , , , .

do ... while ().

(10/15 ), .

C

+4

All Articles