[ Home | Docs | News | Resources | Download]
GAUL Documentation: Example Programs

There are a few trivial example programs distributed with the GAUL source code:

I will be writing some more example and test programs to show off the various features of GAUL... but I will be extremely happy to receive additional contributions to bundle.

"Pingpong" problem solver

Solves the table-tennis championship problem presented in: Dennis E. Shasha, "Dr Ecco's Omniheurist Corner: Foxy", Dr Dobb's Journal, 323:148-149 (2001). Uses a single 25 integer chromosome with custom mutation and crossover operators. This is a perturbation problem. Equivalent, non-GA, versions are also given for the purpose of demonstrating and comparing the built-in search heuristics.

Simple polynomial solver

Solves a function of the form (0.75-A)+(0.95-B)^2+(0.23-C)^3+(0.71-D)^4 = 0. Equivalent, non-GA, versions are also given for the purpose of demonstrating and comparing the built-in search heuristics.

"Wildfires" problem solver

Solves the fire-fighting problem presented in: Dennis E. Shasha, "Dr Ecco's Omniheurist Corner: Wildfires", Dr Dobb's Journal, 320:193-194 (2001). Uses a single boolean array chromosome.

Goldberg's Examples

Ports of the examples from Goldberg's book. Note that I have never read Goldberg's book, so I can't check these. If someone wants to donate the book to me then I would be very grateful ;)

Holland's Royal Road Problem

Holland's Royal Road problem.

The Struggle for Existence

This is a set of examples, each adds or modifies procedures from the previous ones as explained in detail in the GAUL tutorial. These programs aim to generate the final sentence from Chapter 3 of Darwin's "The Origin of Species", entitled "Struggle for Existence". They all use a basic character-valued array chromosome.

  • examples/struggle.c - A fairly fairly lean example, showing how little application code is needed when using GAUL.
  • examples/struggle_ss.c - A steady state version of struggle.
  • examples/struggle2.c - Performs Darwinian, Lamarckian and Baldwinian evolution on seperate populations.
  • examples/struggle3.c - Applies only the Lamarkian version, but adds custom termination rules and some simple statistics.
  • examples/struggle4.c - Uses low-level functions and demonstrates a custom crossover operator.
  • examples/struggle5.c - Multiple population, "Island model" version.
  • examples/struggle5_mp.c - Extends struggle5 to use multiple processes.

Neural Network Evolution

This example evolves a fixed topology neural network. Although the topology of the network is fixed, certian learning parameters are evolved along with the weights. The genome consists of a single chromosome which is simply a datastructure containing the neural network. This is an example where population->len_chromosome is ignored. Both crossover and mutation rates are comparatively low, whilst the Lamarckian adaptation affects all members of the population by performing standard back-propogation with momentum.

Reading and Writing Population Data

An adaptation of the struggle example to illustrate the ga_population_read() and ga_population_write() functions for storing data in files.

This program may be used as follows. When a population is read back from disk, evolution will continue from the point at which it finished prior to being saved to disk.

saveload [-n INTEGER] [-i FILENAME] -o FILENAME
  -o FILENAME   Write a population file to FILENAME.
  -i FILENAME   Read population from FILENAME, otherwise create a new population.
  -n INTEGER    Number of generations to perform.  [default=10]

[ Home | Docs | News | Resources | Download]
Hosted by:
SourceForge Logo
GAUL Button Valid HTML 4.01!

© 2001-2002, "Stewart Adcock" <stewart@linux-domain.com> All rights reserved.
All trademarks on this page are probably owned by their respective companies. You can insert you own favourite disclaimer here.