Gene Expression Programming .NET Framework


Gene Expression Programming (GEP)

GEP is an evolutionary algorithm for function finding. It is explained in detail in a number of books and articles by Candida Ferreira, which you can find at If you are not familiar with GEP it is strongly recommended to understand the basics from the works of Candida Ferreira. In this documentation onwards, an understanding of GEP is assumed.

Framework Stucture

The entire libaray is written in C#.

It is created using .NET Framework 3.5.

GEP is the topmost namespace and anything in this framework will be within that namespace.

This framework does not come with any user interface. Creating a population of expression trees and starting the evolution takes about two pages of source code. This excludes data loading.

The framework is developed in such a way that distributed computing over networks can be implemented in the future.

At the beginning of development the goal was to have an option to choose whether to use float, double or decimal value types, depending on the requirements of the task at hand. Since in C# macros are not as powerful as in C++, there are three namespaces for every value type. The current version supports only float. Creating the double version wouldn't be hard since double and float have indentical functionalities. Developing it for decimals may be more difficult. In GEP.Core.Common all functionalities common to the different values types are included. After that classes in this namespace are extended to work with either value type.

Using Multiprocessor Computers

At the time this libary was developed, .NET multipocessor support was in beta version. So far it does not support multiprocessor machines, but it will be incorporated in the future.

The current problem is that genotypes share two draft arrays that facilitate calculations. Having only one helps reduce cache miss hits and there is no need to create a new array with every new genotype.

When multiprocessor support is implemented most probabily a pool of drafts will be used. The access to this pool will be synchronized and if there is a free draft the thread requsting one will take it and continue or wait, if non is free. There will be no waiting if the number of drafts matches the number of threads.

However, it is still possible to harness the power of multiprocessor computers by creating multiple populations and mixing them from time to time. When doing so you have to make sure all populations mutate constants the same way. A very easy way is to remove constant mutations and have a sufficient number of constants, in order to achieve the necessary precision.

Most probably when implementing the distributed computing over the network this will be the way to keep constants synchronized. This will also reduce network traffic volume, since constants will be transferred only once in the beginning.

GEP .NET Framwork Main Page Logo