Chapter 6 - Programming Your Genetic Algorithms Using the DLL > Overview of the GA Process

Overview of the GA Process

<< Click to Display Table of Contents >>

Navigation:  Chapter 6 - Programming Your Genetic Algorithms Using the DLL >

Overview of the GA Process

Previous pageReturn to chapter overviewNext page

The process of building and evolving a population of individuals is really a very simple one:

1.  Build a population of individuals and chromosomes.

2.  Specify the evolutionary parameters (crossover rate, mutation, etc.)

3.  For each individual in the population:

a. get the chromosome values from the DLL (GALIB32.DLL)

b. compute the fitness function with these chromosome values

c. give the computed fitness back to the DLL

4.  If the best fitness computed (maximum or minimum) is better than the best fitness so far, then update the user's display with the best so far and save the chromosomes.

5.  If either of the following is true, then stop:

a. the best fitness so far is good enough (a problem dependent determination)

b. some number of generations has passed in which no better fitness was found (also a problem dependent determination, but 20 to 50 generations is usually appropriate)

6.  Reproduce the population (make a new generation)

7.  Go to step 3.

 

The program is therefore simply a loop wherein the major task of the program is to compute the fitness of the individuals in the population generation after generation, remembering the chromosomes of the individual which had the best fitness during the entire process.

 

In the discussion that follows, we will refer to the functions in GALIB32.DLL that must be called, but for simplicity we will not show their parameters.  We will leave this for the actual sample code that follows the general explanations.  You may, however, refer to Chapter 8 which contains a complete description of each function found in the DLL.