initperm | R Documentation |
This function generates an initial population when each variable of the chromosomes is desired to be encoded on a rank scale or permutation.
initperm(n, permset, prevpop, type, ...)
n |
Population size |
permset |
A vector of permutation set |
prevpop |
Matrix of solutions used in heuristic and hybrid initialization |
type |
Type of output matrix |
... |
Further arguments passed to or from other methods. |
Unlike other initialization function inputs, the initperm function has an argument called permset. This argument is a vector containing permutation set values. The permutation set can contain numbers or letters. In the initial population, each variable randomly takes any value from this set, but there cannot be two of the same value in a chromosome.
The output matrix includes only chromosomes of initial population when type=2
, otherwise The output matrix includes
chromosomes of initial population and additional two empty columns for generation number and fitness values.
Zeynel Cebeci & Erkut Tekeli
initbin
,
initval
,
initnorm
,
initialize
n = 20 #Population size (number of chromosemes) m = 6 #number of Variables lb = c(10, 2, 5, 100, 50, 25) ub = c(40, 8, 20, 500, 250, 90) population = initval(n, m, lb=lb, ub=ub, nmode="integer") tail(population, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.