Documentation of FARSA Genetic Algorithm


The LaralGA is based on 8 basic classes corresponding to the mains operators and functions of Genetic Algorithm theory. The documentation of these 8 core classes are into the corresponding module reachable by "module" tab above or by link below.
The 8 fundamental classes are:

  • Genotype: this represent a binary string where each bit is the basic element for encoding genes. The Genotype class represent each gene as exactly one bit, but the subclasses could change it and customize the encoding of each gene into binary string. For example, in the RealGenotype a gene is a float number. The fitness is a property (attribute) of Genotype objects.
  • Genome: this represent a population of Genotypes
  • Mutation: is the mutation operator. It's an abstract class (i.e.: not usable as it is). Hence, the subclasses implements concrete mutation strategy implementing the Mutate::mutate method
  • Crossover: is the crossover operator. As Mutation, the subclasses implements concrete crossoving via Crossover::crossover method.
  • Evaluation: is the class delegated to calculate the fitness of Genotypes. Of course, this is an abstract class, and it left to the user the implementation of subclass that represent the target of evolution. Evaluation subclasses will use the Genotype::setFitness method to set the value calculated for the Genotype setted by Evaluation::initialize
  • Selection: is the selection operator. The constraint of this class is that it select only one Genotype returning it after calling Selection::select method implemented by subclasses. The idea behind this is that this operator just Select one Genotype, and then the Reproduction (see later) operator apply the Selection as many times it requires in order to create the pool of selected Genotypes. This design allow to share the same Select operator by sexual and asexual Reproduction strategies.
  • Reproduction: is the reproduction operator. It will generate a new Genome starting from an old one containing the Genotype evaluated by an Evaluation object.
  • GeneticAlgo: and finally the Genetic Algorithm base class.

Classes are divided into modules:


Example of LaralGA shows how to use the genetic algorithm LaralGA and the basic usage of Mutation operators, Genotype types and MultiTrials fitness functions

Examples of using this library lists all examples present into this documentation


The library is available through the SVN repository on Laral server.
Install an SVN client and use the following path for download the source code of Laral-GA:

svn svn+ssh:// 

If you don't have a SVN account on server, ask to Gianluca.