| Previous | Table of Contents | Next |
COMPUTER IMPLEMENTATION
The computer code for this investigation is implemented in the C language and consists in its current version of about 4,000 lines of code. All experiments were run on a SUN platform running UNIX. All parameters for a run are contained in a parameters file described below.
The initial population is generated by a separate program, randArray, which simply generates a population of arrays of integers within certain bounds. For experiments here, the bounds 0 10 were used.
The principal program operates by reading the initial population from standard input performing the genetic algorithm according the settings in the parameters file (taken as an argument), and writing the final population to the standard output. This design is a standard UNIX approach that permits chaining of different variants of the algorithm into an extended algorithm and provides a convenient tool for investigation of time-varying parameters for the program as well.
For each generation, the following steps are performed:
After each step above, the complete population is scanned to see whether any individual has fitness less than the stopping fitness parameter. If so, the genetic algorithm terminates. If not, it continues up to a maximum (parameterized) number of generations.
The Parameters File
The parameters file guides the operation of the genetic algorithm. It contains all problem-specific information as well as all tuning parameters. Each of the entries in the parameters file is described here.
Population parameters:
Random number seed
Stopping parameters
Mutation parameters
Tournament parameters
Fitness Parameters
All fitness parameters here have a default value of 1 unless otherwise specified.
INVESTIGATIONS
The problem examples below are all based on the genetic algorithm formulation above. All examples can be run using the same code formulation with varying values for the problem parameters.
Problem #1: Tight Constraints
The parameters file for this problem is shown here:
Population Fitness
nrow 5 rowsum 25 25 25 25 25
ncol 5 rowfact 1 1 1 1 1
npop 100 rowexp 1 1 1 1 1
Random Seed colsum 25 25 25 25 25
seed 0 colfact 1 1 1 1 1
colexp 1 1 1 1 1
Stopping
stopgen 100
stopfit 0
Mutation
muprob 0.01
murng 5
Tournament
dotour 1
toursize 5
tourwin 1
Crossover
xprob 0.2
The best (minimal) fitness for each generation is shown next:
| Previous | Table of Contents | Next |