C codebase with no dependencies to evolve RISC-like instruction programs using the Multi-dimensional Archive of Phenotypic Elites (MAP-Elites, https://arxiv.org/abs/1504.04909).
Because MAP-Elites can easily explore a 2 dimensional search space, it seems well suited for the evolution of instruction programs, as it can simultaneously evolve multiple candidates and optimize the number of instructions and calls.
In the case of MAP-Elites RISC, the search space is defined as:
X = number of instruction used (size of the program)
Y = number of instruction called during execution (~speed of the program)
The codebase includes a minimal MIPS-like instruction set and interpreter and a generic MAP-Elites implementation.
To compile ex1 type:
gcc example/ex1_pong.c
Or import example/ex1_pong.c in your IDE. You can also run "build_unix.sh", "build_mingw.bat" or "build_vs.bat".
Every 1000 generation the best program is saved as "pong_best.cgen" and "pong_best.cgen.txt" (readable copy).
After the default 500000 generations (~5 min) the process stops and save a preview of the best game in the form of tga frames "pong_frame0000.tga", "pong_frame0001.tga"...
A larger number of generation can progressively optimize the number of instruction and call.
Here is one solution found by MAP-Elites RISC :
5: load ($4, m[$5 + 0])
29: less ($5, $7, $3)
49: sub ($7, $4, $6)
52: store (m[$2 + 3], $7)
62: load ($6, m[$2 + 2])
http://journal.frontiersin.org/article/10.3389/frobt.2016.00040/full
Gene Regulation Network: https://github.com/anael-seghezzi/GRN-Gene-Regulation-Network