Denote parents by \(C^{parent}\) which i-th row
parents[i, ] is a chromosome \(c_{i}^{parent}\) i.e. the vector of
parameter values of the function being optimized \(f(.)\) that is
provided via fn argument of gena.
The elements of chromosome \(c_{ij}^{parent}\) are genes
representing parameters values.
Crossover algorithm determines the way parents produce children.
During crossover each of randomly selected pairs of parents
\(c_{i}^{parent}\), \(c_{i + 1}^{parent}\)
produce two children
\(c_{i}^{child}\), \(c_{i + 1}^{child}\),
where \(i\) is odd. Each pair of parents is selected with
probability prob. If pair of parents have not been selected
for crossover then corresponding children and parents are coincide i.e.
\(c_{i}^{child}=c_{i}^{parent}\) and
\(c_{i+1}^{child}=c_{i+1}^{parent}\).
Argument method determines particular crossover algorithm to
be applied. Denote by \(\tau\) the vector of parameters used by the
algorithm. Note that \(\tau\) corresponds to par.
If method = "split" then each gene of the first child will
be equiprobably picked from the first or from the second parent. So
\(c_{ij}^{child}\) may be equal to \(c_{ij}^{parent}\)
or \(c_{(i+1)j}^{parent}\) with equal probability. The second
child is the reversal of the first one in a sense that if the first child
gets particular gene of the first (second) parent then the second child gets
this gene from the first (second) parent i.e. if
\(c_{ij}^{child}=c_{ij}^{parent}\) then
\(c_{(i+1)j}^{child}=c_{(i+1)j}^{parent}\); if
\(c_{ij}^{child}=c_{(i+1)j}^{parent}\) then
\(c_{(i+1)j}^{child}=c_{ij}^{parent}\).
If method = "arithmetic" then:
$$c_{i}^{child}=\tau_{1}c_{i}^{parent}+
\left(1-\tau_{1}\right)c_{i+1}^{parent}$$
$$c_{i+1}^{child}=\left(1-\tau_{1}\right)c_{i}^{parent}+
\tau_{1}c_{i+1}^{parent}$$
where \(\tau_{1}\) is par[1]. By default par[1] = 0.5.
If method = "local" then the procedure is the same as
for "arithmetic" method but \(\tau_{1}\) is a uniform random
value between 0 and 1.
If method = "flat" then \(c_{ij}^{child}\) is a uniform
random number between \(c_{ij}^{parent}\) and
\(c_{(i+1)j}^{parent}\).
Similarly for the second child \(c_{(i+1)j}^{child}\).
For more information on crossover algorithms
please see Kora, Yadlapalli (2017).