Introduction

GPSTEPS (Genetic Programming SmallTalk Easy Prototyping System) is a 
system for experimenting with Genetic Programming.

It is written in Digitalk Smalltalk VWIN 2.0 and WindowBuilderPro. 
Smalltalk was chosen for its rich graphical capabilities, rapid prototyping 
and pure object orientation. Base object classes provide about 90% of a 
completed GP application.

The Smalltalk source code is provided and an executable (MSDOS Windows 
3.1) version for the Artificial Ant problem.

File Information

After unzipping the following files should be present:

docs.ps
This file


xxxxxxxx.st
The Smalltalk source code


xxxxxxxx.dll
Miscellaneous .DLL files for Smalltalk to run


gpant.exe
An executable Windows program for the Artificial 
Ant simulation


change.log
A support file for Smalltalk. Don't change


readme.txt
Basic documentation


Installation Instructions


Two types of installation are possible, the executable only, and incorporating the 
source in a Smalltalk image. First create a directory called GPSTEPS and copy the 
gpsteps.zip file into it. Unzip the file.

GPAnt Execution Only

Bring up Windows and select the Program Manager 'File/New', 'Program 
Item'. Enter an appropriate description. The command line should be 
c:\gpsteps\gpant.exe. The working directory should be c:\gpsteps. 
Press the 'Change Icon' button. Change the File Name from V.EXE to 
ST.ICO (leave the directory part unchanged) and press enter. When the 
Ant Icon appears. Press the OK button. Press the OK button again in 
the Program Item Properties dialog.

To run tho successfully use the source code provided Digitalk VWIN 
2.0 and WindowBuilderPro must be installed in the destination Smalltalk 
image. Bring up Smalltalk and open a file browser on the Ge application 
simply double click on the Ant Icon.

Smalltalk Souce Installation

To successfully use the source code provided Digitalk VWIN 2.0 and 
WindowBuilderPro must be installed in the destination Smalltalk image. 
Copy the files gponlyin.st and gpbmaps.bdt into the directory 
containing the destination Smalltalk image. Bring up Smalltalk and open 
a file browser on the current directory. Open the file 'gponlyin.st' from 
the browser. Select the entire file and then 'File it it'. This will 
automatically file all the source code required into the running image. 
Several bitmaps must also be filed in to the WindowBuilderPro 
dictionary. To accomplish this select 'Launch Bitmap Manager' from the 
WindowBuilder menu in the Transcript. Press the ALT key and select 
File/Open BitmapFile. Select the 'gpbmaps.bdt'  file and press OK. 
Release the ALT key. This will merge the bitmaps from the gpmaps file 
into the WindowBuilder dictionary. Save the image. The GPAnt program 
may now be run by typing 'GPAntOverlord new open' and 'doing' it.
 


Operation

Execute the program. For the executable simply double click on the GPAnt 
program. For the source version enter 'GPAntOverlord new open' then 'doit'.

GPInitializer Window

The first window that comes up is the GPInitializer. The elements in the 
window are described below.

  Log Comment
  This comment will be written as the first 
  record in the GPLOG.TXT file which 
  stores the best program in each generation 
  to disk.


  Selection Type
  Default is 'Fitness Proportionate'. To 
  chose 'Tournament' simply activate the 
  drop down menu and select 'Tournament'.


  Tournament Size
  Visible only if Tournament selection is 
  activated. Controls the size of the 
  tournaments. A value between 2 and 7 
  seems to work best.


  Population Size
  Selects the number of programs in the 
  initial population. 500 is a reasonable 
  starting number for fitness proportionate 
  selection, 1000 for tournament selection.


  Max Initial Depth
  Sets the max tree depths for the initial 
  programs.


  Max Depth
  Sets the max tree depth during crossover. 
  If after mating a program exceeds this 
  level it is abandoned and mating proceeds.


  Random Number Seed
  Sets the random 
  number generator seed. Different starting 
  numbers will produce different results.



Initializer Status Window

The next window is the Initializer Status window. This window has no controls 
but simply indicates the status of the initial genetic operations.

Main Window

Control Panel

The main window has several panes and is displayed next. Its upper left corner 
has the control panel.

  Evolve
  Sets the number of generations to 
  evolve. The fitness, program, and 
  graph panes are updated after each 
  generation. The program halts when 
  the required number of generations 
  has been completed. A good starting 
  point is 50.
 

  Begin
  Press this button to begin evolution. 
  Pressing this button simply allows 
  the evolution to continue and does 
  not reset the population.


  Active Program
  Shows the program currently being 
  evaluated for fitness.



Program Summary Pane

Below the control panel is the 'Program Summary' pane. This pane summarizes 
the current status of the population of programs. The entries in this pane are 
sorted by fitness and number of nodes so that the most fit program with the 
smallest node count is at the top. Selecting a program with the mouse displays 
it in the program pane below it. Double clicking on a program makes the GPAnt 
run the program in the Ant Feeding Area. A menu is also associated with this 
pane. The menu is activated by pressing the right mouse button while the 
cursor is within the pane's boundaries. The menu allows execution of the 
program (same as double clicking on a program), filing out the currently 
selected program, and filing out the entire population.

Program Display Pane

This pane displays, in outline format, the program currently being selected in 
the 'Program Summary' pane.

Ant Feeding Area

This pane is where the GPAnt performs under the control of the selected 
program.

Graph Pane

The Graph pane is at the bottom right of the main window.
This pane displays a history of the best of generation fitness. It starts with an X 
axis of 100 generations. If more than 100 generations are performed it will 
expand appropriately.

About Button

This displays some program information when pressed.



Class Descriptions


GPOverlord
Handles the user interface. Instructs the 
associated GPCustodian to perform very 
high level operations. Currently only one 
GPCustodian is supported but it is a simple 
change to support multiple custodians to 
allow 'deme' operation.


GPCustodian
Controls the genetic operations. Handles 
program selection, crossover, and fitness 
evaluation. Reports progress to the 
GPOverlord.


GPComputer
Has an 'instruction set' identical to the 
functions and terminals selected for the 
problem being solved. When a 'program' 
(actually the rooted tree) is loaded and run 
it updates the state of any associated 
objects (the Ant in this case). Execution 
'time' is monitored if required.


GPProgram
Is a collection of interconnected nodes. 
The GPCustodian is responsible for 
performing operations on each 
GPProgram, and the GPComputer can load 
and execute them.


GPNode
A collection of these form a GPProgram. 
Each node has a child, sibling, type (Term 
or Func), and a value.


GPProgramGenerator
Handles the initial program generation. 
Currently implements the ramped half and 
half specified by Koza.


GPRandomizer
Straight conversion to smalltalk from 
'Ran2'  in Numerical Recipes in C. 


GPAnt
The star of the show. Sent instructions 
from the GPComputer. Interacts with the 
GPFoodPlain. Knows its position, 
direction and total food consumed (pretty 
smart for an ant).


GPFoodPlain
Contains the initial food locations and 
keeps track of the food consumed by the 
ant. Can display itself in its window pane 
for the GPOverlord



Creating New GP Applications

 Two applications are included in the supplied source code, GPAnt and 
Symbolic Regression. A new GP application requires coding new subclasses of 
the existing base classes.

GPComputer subclass

- Write a method which initializes the Function and Terminal class variables.
- Add a method for each function and terminal.

GPCustodian subclass

- Write an 'evaluateIndividualFitness' method

GPOverlord subclass

- Write the initialization procedures
- Write a 'programDisplay' method when the user double clicks on a 
GPProgram in the program window

Additional Classes

- Some applications may require the addition of other objects, i.e. an ant.


Additional Information

Any questions or comments are welcome. Please e-mail them to me at 
poliquin@netcom.com. Continuous changes are always being made. If there is 
enough interest I may port the classes to ParcPlace Smalltalk which has a 
Unix platform.


