initbin: Initialize the population with binary encoding
Description
The initbin function is an initialization function that can be used for binary encoding. It generates an initial population of population size n and chromosome length m.
Usage
initbin(n, m, prevpop, type, ...)
Arguments
n
Population size
m
Chromosome length
prevpop
Matrix of solutions used in heuristic and hybrid initialization
type
Type of output matrix
…
Further arguments passed to or from other methods.
Value
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.
# NOT RUN {n = 20#Population size (number of chromosemes)m = 5#Number of gene (chromosome length)population = initbin(n, m)
head(population, 4)
tail(population, 4)
# }