hgaroi {adana}R Documentation

GA + ROI hybridization function

Description

This function allows GA to hybridize with methods in the ROI package (Theussl et.al., 2020).

Usage

hgaroi(genpop, fitfunc, hgaparams,
                  hgaftype, hgans, ...)

Arguments

genpop

A matrix of individuals in the current population and their fitness values.

fitfunc

Fitness function

hgaparams

A list of parameters defined for use by the Optim function.

hgaftype

Types of fitness to transfer.

  • w: individuals with the worst fitness value

  • b: individuals with the best fitness value

  • r: randomly selected individuals

hgans

Number of individuals to be transferred to the Optim.

...

Further arguments passed to or from other methods.

Value

A matrix containing the updated population.

Author(s)

Zeynel Cebeci & Erkut Tekeli

References

Theussl, S., Schwendinger, F. and Hornik, K. (2020). ROI: An extensible R optimization infrastructure. Journal of Statistical Software, 94(15), 1-64.

See Also

hgaoptim, hgaoptimx

Examples

n = 5                                 # Size of population 
m = 2                                 # Number of variable
lb = c(-5.12, -5.12)                  # Lower bounds of sample data
ub = c(5.12, 5.12)                    # Upper bounds of sample data
hgaparams = list(method="L-BFGS-B", 
  poptim=0.05, pressel=0.5,
  lower=lb, upper=ub,
  control=list(maxit=100))
genpop = initval(n, m, lb=lb, ub=ub)  # Sample population
fitfunc = function(x, ...) 2*(x[1]-1)^2 + 5*(x[2]-2)^2 + 10
fitvals = evaluate(fitfunc, genpop[,1:m])
genpop[,"fitval"]=fitvals
genpop
genpop = hgaroi(genpop, fitfunc, hgaparams, 
  hgaftype="r", hgans=3)
genpop

[Package adana version 1.1.0 Index]