gena.population | R Documentation |
Initialize the population of chromosomes.
gena.population(pop.n, lower, upper, pop.initial = NULL, method = "uniform")
pop.n |
positive integer representing the number of chromosomes in population. |
lower |
numeric vector which i-th element determines the minimum possible value for i-th gene. |
upper |
numeric vector which i-th element determines the maximum possible value for i-th gene. |
pop.initial |
numeric matrix which rows are initial chromosomes suggested by user. |
method |
string representing the initialization method to be used. For a list of possible values see Details. |
If "method = uniform"
then i-th gene of each chromosome is randomly
(uniformly) chosen between lower[i]
and upper[i]
bounds. If
"method = normal"
then i-th gene is generated from a truncated
normal distribution with mean (upper[i] + lower[i]) / 2
and
standard deviation (upper[i] - lower[i]) / 6
where lower[i]
and upper[i]
are lower and upper truncation bounds correspondingly.
If "method = hypersphere"
then population is simulated uniformly
from the hypersphere with center upper - lower
and radius
sqrt(sum((upper - lower) ^ 2))
via rhypersphere
function setting type = "inside"
.
This function returns a matrix which rows are chromosomes.
B. Kazimipour, X. Li, A. Qin (2014). A review of population initialization techniques for evolutionary algorithms. 2014 IEEE Congress on Evolutionary Computation, 2585-2592, <doi:10.1109/CEC.2014.6900618>.
set.seed(123) gena.population(pop.n = 10, lower = c(-1, -2, -3), upper = c(1, 0, -1), pop.initial = rbind(c(0, -1, -2), c(0.1, -1.2, -2.3)), method = "normal")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.