R/adana3.R

Defines functions adana3

Documented in adana3

# Dynamic mutation and crossover function (Adana 3)
adana3 = function(fitvals, g, gmax, cxpc, mutpm,
                  adapc, adapd, ...){
  if(missing(adapc)) adapc = 0.05
  if(missing(adapd)) adapd = 0.05
  fmin = min(fitvals)
  fmax = max(fitvals)
  favg = mean(fitvals)
  newrate = ifelse(g/gmax>=0.01, g/gmax,0.01)
  pca = ifelse((fmax-favg)/fmax <= adapc, newrate, cxpc)
  pma = ifelse((fmax-favg)/fmax <= adapd, newrate, mutpm)
  return(list(pc=pca, pm=pma))
}

Try the adana package in your browser

Any scripts or data that you put into this service are public.

adana documentation built on March 18, 2022, 6:03 p.m.