Clone wiki

GAF / Home


| ------------|------------ Getting Started|Population Chromosomes and Genes|Genetic Operators Events|Fitness and Termination Examples|The GAF Evaluation Server Evaluating using Docker Swarm


The Genetic Algorithm Framework (GAF) is designed to be the simplest way to implement a genetic algorithm in C#. The GAF is a .Net/Mono assembly, freely available via NuGet, that allows a genetic algorithm based solution to be implemented in C# using only a few lines of code.

This documentation describes how to use the Genetic Algorithm Framework as part of a C# project typically using Visual Studio or Xamarin. For a full explanation of what a genetic algorithm is, and what it can do, please see the CodeProject article Implementing Genetic Algorithms in C#.

The GAF has been designed to be as generic and extensible as possible whilst at the same time being simple to use. The single assembly contains all that is needed for many combinations of genetic algorithm. Many popular genetic operators are provided within the GAF, in addition, external operators can be defined and added to the GA process pipeline as required by the consumer.

The software is provided under the following Licence.


  • The GAF is distributed as a single .Net/Mono Assembly and can be easily added to any Visual Studio or Xamarin project using NuGet.

  • Evaluation and Terminate functions are externally defined thereby allowing almost any type of fitness or terminate function to be used.

  • The GAF includes many Genetic Operators including Crossover (single and double point), Mutate, Elite, Copy, Swap Mutate and Random Replace.

  • The GAF NuGet package includes versions for .Net 4.0, .Net 4.5 and PLC (Profile 78). This allows it to be used in most applications, including those targeting Xamarin.IOS, Xamarin.Android, Xamarin.Mac, Silverlight, Windows Store Apps and Windows Phone 8+.

  • The IGeneticOperator interface can be used to easily create new custom operators for use with the GAF.

  • New operators can be derived from existing operators to provide additional functionality.

  • Genetic operators have thread safe parameters that can be changed whilst the GA is running.

  • The population can present each solutions fitness as either an actual or linearly normalised value.

  • The evaluation process can make use of the Parallel Task Library (.Net 4.0/4.5 versions only).

  • The evaluation process can be distributed amongst several distinct machine or container instances (.Net 4.0/4.5 versions only).

Getting Started

To get started, simply install the GAF using the NuGet Package Manager. Execute the following command at the Package Manager Console.

PM> Install-Package GAF

See the article Getting Started for details and further documentation.