Description Usage Arguments Details Value Author(s) See Also Examples
This function creates a population of given size of random real-values.
1 | crtrp(Nind,FieldDR)
|
Nind |
a value containing the number of individuals in the new population. |
FieldDR |
a matrix of 2 rows by number of variables describing the boundaries of each variable. |
The first step in a genetic algorithm is to create an initial population consisting of
random individuals. crtrp
produces a matrix, Chrom
, containing uniformly
distributed random values in its elements.
Chrom = crtrp(Nind, FieldDR)
creates a random real-valued matrix of
size Nind * Nvar
, where Nind
specifies the number of individuals in the
population and Nvar
the number of variables of each individual. Nvar
is derived
from FieldDR
with Nvar = NCOL(FieldDR)
.
FieldDR
is a matrix of size 2 * Nvar
and contains
the boundaries of each variable of an individual. The first row contains the lower
bounds, the second row the upper bounds.
FieldDR
is used in other functions mutate
a matrix containing the random valued individuals of the
new population of size Nind
by number of variables.
The original matlab implementation of crtrp was written by Hartmut Pohlheim and tested by Alex Shenfield. The R implementation was written by David Zhao.
mutbga
, recdis
, recint
, reclin
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.