Genetic Algorithm Evolution


A very rough-around-the-edges genetic algorithm.

The concept is to generate random creatures with ‘neurons’ that have a specific function (ex. add, subtract, multiply, sin) and neurons that have numbers (ex. time, position) and these neurons with numbers output to other functional neurons which then output to muscles. The value outputted to a muscle then tells the muscle how much to contract and expand (positive to expand, negative to contract). And as the genetic algorithm progresses, (if it works out well), a cyclical function is hooked up to a muscle (ex. time -> sin(time) -> muscle) which causes constant expansion and contraction and has the potential to allow movement.

For a very long time, the creatures are slow; but they almost always converge towards a fast creature through small perturbations of their neurons and muscle resiliency along with actual initial placement and amount of neurons/muscles.

The goal of the creatures is to move as far from the center (either left or right) as possible within 10 seconds.

I have seen creatures get all the way up to a couple hundred meters after a few hours of testing, so it works pretty well sometimes.