background preloader

Alife

Facebook Twitter

A "Hello World!" Genetic Algorithm Example. Somebody over on the Generation5 forum asked for a "Hello World!

A "Hello World!" Genetic Algorithm Example

" program for genetic algorithms. I took it literally and created a very simple program (138 lines of code) that evolves the phrase "Hello world! " Here is some sample output (best population member and the fitness are displayed): Best: IQQte=Ygqem# (152) Best: Crmt`! Qrya+6 (148) Best: 8ufxp+Rigfm* (140) Best: b`hpf"woljh[ (120) Best: b`hpf"woljh4 (81) Best: b`hpf"woljh" (63) Best: Kdoit! Genetic Algorithm The GA has the following characteristics: There are a few things to note about the code as well.

Fitness Function Finally, a quick look at the fitness function: void calc_fitness(ga_vector &population) { string target = GA_TARGET; int tsize = target.size(); unsigned int fitness; for (int i=0; i<GA_POPSIZE; i++) { fitness = 0; for (int j=0; j<tsize; j++) { fitness += abs(int(population[i].str[j] - target[j])); } population[i].fitness = fitness; } } Conclusion Article content copyright © James Matthews, 2003. The breve Simulation Environment. What is breve?

The breve Simulation Environment

Breve is a free, open-source software package which makes it easy to build 3D simulations of multi-agent systems and artificial life. Using Python, or using a simple scripting language called steve, you can define the behaviors of agents in a 3D world and observe how they interact. breve includes physical simulation and collision detection so you can simulate realistic creatures, and an OpenGL display engine so you can visualize your simulated worlds. breve is available for Mac OS X, Linux and Windows in the download section. breveCreatures screensaver 2.7 now available for download [02/19/08] breve 2.7.2 now available for download [02/19/08] breve 2.7.2 fixes a crash during startup on Mac OS X, issues with the breveIDE for Windows and Linux, and a problem deleting objects in Python simulations. breve 2.7 adds some major new features, including: Support for non-convex shapes. Write Your Own Simulations Interface With Your Own Code Feedback and Bug Reports About the Author Links.

Push, PushGP, and Pushpop. Introduction Push is a programming language designed for evolutionary computation, to be used as the programming language within which evolving programs are expressed.

Push, PushGP, and Pushpop

A concise introduction to the most recent standardized version of the language ("Push3") is contained in The Push 3.0 Programming Language Description. Versions of Push written in Common Lisp, C++, JavaScript, Java, Scheme and Clojure are available (see below). Note, however, that Push is the subject of continuous research and development, and that each implementation varies from the Push3 standard in a variety of ways; see the implementation-specific documentation for details.

PushGP is a genetic programming system that evolves programs in the Push programming language. Multiple data types without constraints on code generation or manipulation. A variety of Push-based evolutionary computation sytems other than PushGP have been developed, including several (e.g. There is a Push email list and a new Push project blog.