byte_crossover_1p: Performs one-point crossover operation on a pair of two...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/oplibrary.R

Description

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 byte_crossover_1p than the byte-coded one-point crossover operator is applied in the genetic search. In mcga2 function, the hard-coded crossover parameter is set to byte_crossover by definition. byte_crossover_1p function simply takes two double vectors (parents) and combines the bytes of doubles using given cut-point.

Usage

1
byte_crossover_1p(object, parents, ...)

Arguments

object

A GA::ga object

parents

Indices of the selected parents

...

Additional arguments to be passed to the function

Value

List of two generated offspring

Author(s)

Mehmet Hakan Satman - mhsatman@istanbul.edu.tr

References

M.H.Satman (2013), Machine Coded Genetic Algorithms for Real Parameter Optimization Problems, Gazi University Journal of Science, Vol 26, No 1, pp. 85-95

See Also

mcga2

Examples

1
2
3
4
5
6
7
f <- function(x){ 
  return(-sum( (x-5)^2 ) )
}
myga <- GA::ga(type="real-valued", fitness = f, popSize = 100, maxiter = 200, 
              min = rep(-50,5), max = rep(50,5), crossover = byte_crossover_1p,
              mutation = byte_mutation)
print(myga@solution)

mcga documentation built on May 19, 2017, 7:25 p.m.

Search within the mcga package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.