Genetic is a project mainly written in C++ and C, it's free.
Playground for some genetic programming.
This application provides a modular framework for genetic evolutionary algorithms. In order to use this framework, two parts are required:
This application consists out of three sets of files:
1) DNA format
The client accepts DNA in two different forms:
Genes consist out of bytes, ranging between 1 and 254 (so 253 instructions are possible). The environment can interprete genes the way it likes, which increases the amount of possibilities hugely. I.e., an environment in which a creature moves through a world, could instruct the first byte of a gene to be the instruction (move, shoot, jump), and the two following bytes to be the coördinates. This interpretation does not change the way the client mutates the bytes.
When using the queue representation, there are some special possibilities: 255: marks the DNA bounds, every queue should start and end with 255 0: sperates genes
2) Description of the environment
The client will call the environment on several occasions, so it needs to have implemented a certain amount of functions.
Over time, this application has been written and re-written several times. Mostly because of the lack of preparation, but also because the subject isn't documented much and thus difficulties tend to get discovered on-the-run.
1) Initial Perl version
This first implementation, written in Perl, works quite well but only supports a single hard-coded environment (creature running through a obstacle-filled world), and a single-straight evolutionary path. Still, it is cleanly written and demonstrates the principles of evolutionary code.
Download: "/trunk/archive/attempt 1/" @ r81
2) C++ rewrite
Essentially this is the raw C++ rewrite of the initial Perl version. Although it only adds one important features (simple population-based evolution), its mutation algorithms are more advanced and it generally works a lot faster. The environment though is still hard-coded. However, the project seems to contains some memory-leaks, which I did not find.
Download: "/trunk/archive/attempt 2/" @ r81
3) STL rewrite
Due to the memory leaks in the previous version, I attempted another rewrite, eliminating use of pointers and replacing them with STL containers. During the write however, I decided it was flawed by design, and decided to abandon this version and include modularity in the design. Still, this version worked well, apart from a memory leak and a yet undiscovered segmentation fault.
Download: "/trunk/archive/attempt 3/" @ r81
4) Modularity
This rewrite introduced modularity, using a user-implementable Environment.
Download: "/trunk" @ r62
5) DNA redesign
Download: "/trunk" @ HEAD