Generates an initial population for a genetic algorithm (GA). Each individual
is a binary chromosome represented by a numeric vector containing 0 and 1.
Usage
create.pop(npop, nbits)
Value
A numeric matrix with npop rows and nbits columns containing only 0 and 1.
Each row corresponds to one chromosome.
Arguments
npop
Integer. Number of individuals (chromosomes) in the population.
nbits
Integer. Number of bits in each chromosome.
Author
Zhonghui Huang
Details
Bits are sampled independently. Each bit takes the value 0 or 1 with equal
probability.