TinyGP is a symbolic regression system with the
- The terminal set includes
a user-definable number of floating point variables (named
X1 to XN).
- The function set includes
multiplication, protected division, subtraction and addition.
- The fitness cases are read
from a file (the format is given below).
- The system is steady
state. A "generation" is considered concluded when POPSIZE (see below)
crossover/mutation events have been performed.
- Selection is performed
using tournament selection.
- Negative tournaments are
used for the selection of the individuals to be replaced at each
- Subtree crossover is used.
The selection of crossover points is uniform, so every node is chosen
- Point mutation is used.
That is, points (nodes) in the tree are randomly chosen. If a point is
a terminal, then it is replaced by another randomly chosen terminal. If
it is a function, then it is replaced by another randomly chosen
function with the same number of inputs.
- The following parameters
are implemented as static class variables:
- The maximum length any GP program can take:
- The size of the population:
- The maximum depth initial programs can have:
DEPTH. Note 0 represents the depth of programs containing just
- The maximum number of generations allowed for a run: GENERATIONS.
- The probability of creating new individuals via
The mutation probability is 1 - CROSSOVER_PROB.
- The mutation probability (per node) when point
mutation is chosen as the variation operator:
- The tournament size: TSIZE.
- The parameters and the
random seed are printed when each run starts.
- The fitness function is
minus the sum of the absolute differences between the actual program
output and the desired output for each fitness case. TinyGP maximises
grow initialisation method is used to create the initial
- At each generation the
following statistics are calculated and printed:
- The generation number.
- The average fitness of the individuals in the
- The fitness of the best individual in the
- The average size of the programs in the current
- The best individual in the population.
- The random number
generator can be seeded via the command line. If this command line
parameter is absent, the system uses the current time to seed the
random number generator.
- The name of the file
containing the fitness cases can be passed to the system via the
command line. If the command line parameter is absent, the system
assumes the data are stored in the current directory in a file called
- If the total error made
by the best program goes below 10-5 TinyGP prints a message indicating success
and stops. If the problem has not been solved after the maximum number
of generations, it prints a message indicating failure and stops.