Of a function y = f(x), we know a number of samples yi = f(xi). Let's call this function the "target function" and the samples the "fitness cases". Our goal is to find an approximation of the target function in symbolic form. We measure the quality of the approximation by the sum of the absolute differences of the target function values and the approximation function values at the sample points. This number is also called the "fitness" of an approximating function.

The Main Panel

In the main panel, you may control the genetic program and inspect the results.
Click the Start button to launch the genetic program. Use the Pause/Resume button to hold and resume the program. The Stop button aborts the program. Use the Settings button to inspect and change some parameters for the program.

The Approximation window shows a cartesian diagram with several traces:

When a complete generation has been evaluated, the Fitnesses window displays a histogram of the fitness values of all individuals.

The Status window indicates what is currently happening.

The Results window displays a symbolic representation of the best approximation function found so far, along with some other data.

Settings for the Genetic Program

You may inspect or change some parameters of the genetic program in the Settings dialog. Call it up with the Settings button.
Note that you cannot change the settings while the genetic program is running. Therefore, the Settings button is enabled only when the program is stopped.

Brief explanation of settings
Population size The number of individuals (i.e. synthesized programs) in the population. Each generation has the same number of individuals.
Max. depth for new individuals The maximum depth of program trees for new individuals.
Crossover fraction

Reproduction fraction

Mutation fraction

When producing a new generation, new individuals are generated from the old population by three methods:
  • crossover of two parents, producing two offsprings
  • reproduction of a single parent, producing one offspring
  • mutation of a single parent, producing one offspring

The ratio of the fraction numbers determines the ratio of the methods chosen.

Max. depth for individuals after crossover The maximum tree depth for programs produced by crossover. If an offspring exceeds this limit, one of the parents is chosen instead.
Max. depth for new subtrees in mutants The maximum depth of subtrees that are spliced in at mutation.
Method of generation Determines the shape of the program trees in the initial population:
  • Grow produces randomly bushy trees not exceeding a maximum depth. The distance from the root to the terminal nodes varies randomly.
  • Full produces fully balanced trees. The distance from the root to any terminal node is the same.
  • Ramped half and half is a mixture between the Grow and the Full method. Half of the trees are fully balanced and the other half is created bushy. The maximum depth varies between a minimum (typically 2) and the maximum value that you set with Max. depth for new individuals above.
Method of selection Determines the method how parents are selected when breeding a new generation:
  • Fitness proportionate prefers fitter individuals as parents. The fitter an individual, the more likely it is chosen as parent.
  • Tournament selects the fittest parent(s) out of a pool of randomly chosen individuals.
Fitness cases These are the samples of the target function that we are trying to approximate. The fitness cases are a series of x-y value pairs (x is the independent variable, y is the function value).
To enter your own fitness cases, either type in the values or paste them from the clipboard.
You may embed comment lines. Comment lines start with "//".
You must enter at least 10 x-y pairs.
Function set The list shows all the functions available. Functions are the internal nodes of the program trees.
The algorithm uses only those functions that you have selected in the list.
You must select at least one item.
Terminal set The list shows all the terminal types available. Terminals are the leaves of the program trees.
The algorithm uses only those terminals that you have selected in the list.
You must select at least one item.