blx_crossover | R Documentation |
This function is not called directly but is given as a parameter in GA::ga
function.
In GA::ga
, if the parameter crossover=
is set to blx_crossover
than
the blx crossover operator is applied in the genetic search.
blx_crossover(object, parents, ...)
object |
A |
parents |
Indices of the selected parents |
... |
Additional arguments to be passed to the function |
List of two generated offspring
Mehmet Hakan Satman - mhsatman@istanbul.edu.tr
f <- function(x){
return(-sum( (x-5)^2 ) )
}
myga <- ga(type="real-valued", fitness = f, popSize = 100, maxiter = 100,
min = rep(-50,5), max = rep(50,5), crossover = blx_crossover)
print(myga@solution)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.