[galib] Question about genome initialization from a beginner

Kang Zhao kzhao at emich.edu
Tue Aug 29 13:15:06 EDT 2006


Hi,

I am new to GAlib and I got stuck in genome initialization.

I wanna define genomes as 1D integer arrays, the elements of which have 
random values ranging from 1 to 20. The population contains 500 such 
genomes.

I know there are functions to generate random numbers but am not sure 
how to set the 1D array as random values from 1 to 20. Any ideas? Is 
there an example on how to do this?

Thanks!


KZ



More information about the galib mailing list