r - Pass population to Genetic Algorithm -


i have started learning ga in r.

given have below function:

f <- function(x)  (x^2+x)*cos(x) min <- -10; max <- 10 curve(f, min, max, n = 1000) 

i know, can call ga on using below code:

library(ga)  ga <- ga(type = "real-valued", fitness = f, min = min, max = max,monitor =false)  summary(ga) 

but now, i wondering if can pass vector containing 300 values, and ask ga to randomly select 100 out population(300)?

point: have read ga_lrselection, don't know how use them


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -