<< Click to Display Table of Contents >> MakeChromosomePool |
|
MakeChromosomePool(Population As Integer, ChromoPool As Integer, PoolSize As Integer, Precision As Integer, MaxValue As Single, MinValue As Single)
Purpose: This function creates a chromosome pool. A chromosome pool is an array of continuous chromosomes. The parameter PoolSize determines the number of continuous chromosomes in the pool. Each parameter (independent variable) of the problem corresponds to a separate chromosome in the chromosome pool. The chromosome pool is useful especially in those cases when a very large number (1,000-10,000) of identical continuous chromosomes must be created. Such a situation will occur, for example, when GeneHunter is applied to the training of a neural net. Each weight of the net is considered to be a continuous chromosome in the pool, so PoolSize equals the number of the network’s weights. In this function, the user specifies the bit resolution and the maximum and minimum values of all chromosomes in the pool.
Note: There are two ways to implement continuous chromosomes in GALIB32.DLL:
1. Create each chromosome individually using the MakeChromosome function. In this case, you must call the function each time you want to create a continuous chromosome.
2. Create a chromosome pool using the MakeChromosomePool function. This function is very useful in cases where you need to create a large number of chromosomes at one time. If you call the function once, it will create a large number of completely identical continuous chromosomes. There are, however, some points that you should understand:
a. Integer chromosomes within the chromosome pool created by the MakeChromosomePool function are not available. b. An advanced operator, Diversity, cannot be applied to the chromosome pool during evolution. The SetDiversity operator may be applied only to those individual chromosomes created by the MakeChromosome function.
Arguments: Population is the number of the population in which you want to create a chromosome. ChromoPool is a number of the chromosome pool that you are going to create. You may use up to 200 chromosome pools in one population. Chromosome pools are made one by one, and their numbers should be successive. The first chromosome pool has number 0. A new chromosome pool may be added at any time. PoolSize is the number of continuous chromosomes in the pool. The maximum value of PoolSize is 10,000. Precision is a number specifying bit resolution for all chromosomes. Three values are possible: 1 = 8-bit resolution. The search will be made on the grid consisting of 256 (2^8) points. 2 = 16-bit resolution. The search will be made on the grid consisting of 65,536 (2^16) points. 3 = 32-bit resolution. The search will be made on the grid consisting of 4,294,967,296 (2^32) points. You may use the symbolic constants BIT8, BIT16, and BIT32 found in GALIB32.BAS to code these precision values. The value of the precision parameter determines the theoretical limit of a solution's accuracy. When rough approximation is enough, a low resolution may be used. When the problem is highly sensitive to small variations in parameters, you may wish to use chromosomes with a higher resolution. Usually, a 16-bit resolution is appropriate. Sometimes it is beneficial to compare solutions obtained for different chromosome resolutions. MaxValue is the high limit of any chromosome's value. The search for an optimum value will be performed up to and including this limit. MinValue is the low limit of any chromosome’s value. The search for an optimum value will be performed down to and including this limit.
Note: The min/max values and bit resolution are related. If a variable's minimum value is 0, the maximum value is 100, and the bit resolution is 8 bits, then only 256 points between 0 and 100 are possible. Therefore, the variable will take on value increments of .0039. In other words, it will take on values of 0, .0039, .0078, .0156, etc.
Example: i = MakeChromosomePool(PopNum, 0, 10000, Bit16, 100, -100)
This example creates a chromosome pool with number 0 in the population designated by PopNum. The pool contains 10,000 identical continuous chromosomes. The chromosome resolution will be 16 bits and the search range will be from -100 to 100 for all chromosomes.
Related Functions: GetChromosomePool, PutChromosomePool |