<< Click to Display Table of Contents >> PutEnumChromosome |
|
PutEnumChromosome(Population As Integer, Individual As Integer, EnumChromosome As Integer, ChromosomeArray As Integer)
Purpose: This function sets an enumerated chromosome to specified values from an array in your program. Use PutEnumChromosome when you want to start from a predetermined state of chromosomes in the population (e.g. to continue using a previously saved population). Normally, you will not have to use PutEnumChromosome because GeneHunter initializes chromosomes to random values when MakeEnumChromosome is called.
Arguments: Population is the number of the population with which you are working. Individual is the number of the individual whose enumerated chromosome values you want to set. Individual numbers start with 0. EnumChromosome is the number of the enumerated chromosome whose values you want to set. Chromosome numbers start with 0. ChromosomeArray is an integer array in your program where the values of the chromosome to be passed are stored.
Example: i = PutEnumChromosome(PopNum, 0, 1, ChromosomeArray(0))
This example sets the enumerated chromosome 1 of individual 0 in the population with a number stored in the PopNum variable, to the values stored in the integer array ChromosomeArray.
Related Functions: GetEnumChromosome, MakeEnumChromosome |