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
Post a Comment