Entries Tagged as 'source code'

The SantaFe Trail is a textbook beginner’s problem in genetic programming. The ants are allowed to turn right or left or to move forward. Ants can see food if it is directly in front of them. The Trail is the one in the image above and it is also in the source code.
Ants follow two finite state machines, one if it sees food, another if it does not see food. Optimally the see food machine would only have move forward. But we let nature decide that.
Ants are created, given a random set of instructions and move one instruction each cycle. Then entire swarm moves a given number of cycles, then a new generation is born. The top half of the food finders in the generation mate. One mate contributes the ’see food’ states, one the ‘doesn’t see food states’ and one move is randomly changed in each string of moves. The population is kept at a constant number.
Source Code:
Santa Fe Ants ( Java )
Papers:
Cartesian Genetic Programming (pdf )
Selection in massively Parallel Genetic Algorithms
Ant Algorithms for Discrete Optimization
See also:
Evolutionary AI
Tags: source code
Polyworld is an evolutionary environment with simulated physics that allows you create creatures that will evolve. The creatures are free form neural networks. It was created by Larry Yaeger. They will learn to find food, become or hunt prey and mate and have children. It is open source, code is available at Source Forge ( link below ) and it does have versions for Windows, Linux and OSX.
Although we have had great success solving toy problems in artificial environments evolved creatures in virtual environments haven’t found great success in solving real world problems yet.
PolyWorld is a computational ecology that I developed to explore issues in Artificial Life. Simulated organisms reproduce sexually, fight and kill and eat each other, eat the food that grows throughout the world, and either develop successful strategies for survival or die. An organism’s entire behavioral suite (move, turn, attack, eat, mate, light) is controlled by its neural network “brain”. Each brain’s architecture–it’s neural wiring diagram–is determined from its genetic code, in terms of number, size, and composition of neural clusters (excitatory and inhibitory neurons) and the types of connections between those clusters (connection density and topological mapping). Synaptic efficacy is modulated via Hebbian learning, so, in principle, the organisms have the ability to learn during the course of their lifetimes. The organisms perceive their world through a sense of vision, provided by a computer graphic rendering of the world from each organism’s point of view. The organisms’ physiologies are also encoded genetically, so both brain and body, and thus all components of behavior, evolve over multiple generations. A variety of “species”, with varying individual and group survival strategies have emerged in various simulations, displaying such complex ethological behaviors as swarming/flocking, foraging, and attack avoidance.” ( introduction to PolyWorld: Life in a new context ( link below ))
More information:
Poly’s world
Download source code for PolyWorld
Papers:
Polyworld, Yaeger ( pdf)
Computational Genetics, Physiology, Metabolism, Neural Systems, Vision and Behavior or PolyWorld: Life in a new context ( pdf)
You Tube:
PolyWorld: Google Tech Talks
Tags: cool open source ai projects · source code
I am finishing up my reading of ‘The Magic Machine: A Handbook of Computer Sorcery
‘ and there were only two programs left to write. I thought I’d wipe the first one out in a day. Heh, it took three.
In a chapter of the book the author discusses early attempts at genetically evolving artificial life. He gives a rough algorithm and states he had all kinds of critters running around in just a few hundred generations. I loosely wrote a program based on his algorithm. 150,000+ cycles, and 36 hours on my computer later, no evolution. I don’t know how he did it? I couldn’t get the algorithm in the book to produce any interesting results.
I did today get a program that has bugs that learn to stay on and follow food lines drawn in the window. It takes about 1500 days ( cycles ) for them to achieve this universally. The source code is linked to below.
Here’s what I learned in my attempts at a very simple genetic program.
If you place food randomly there is nothing to learn. You just end up with a population of stupid bugs. Adjusting the food nutrient content worked better than adjusting the amount of food for controlling population levels and for evolution. Creating more food to meet the population just created lots of stupid bugs. ( I wonder if there is a real life lesson in that? )
If you adjust the bugs DNA when they find food, not just their energy levels they learn much faster.
I hope to do some more complex and interesting evolution programs soon.
Source Code:
Bugs.java
See also
Evolutionary AI for more information and several useful links and papers to get you started.
SantaFe Ants
Tags: game ai · source code