leshchenko1979 / fishbowl

Simulating evolution of fish intelligence in a fishbowl using genetic algorithms
0 stars 0 forks source link
artificial-intelligence ecosystem-modeling generation-algorithms neat-algorithm neural-network neuroevolution variable-topology

fishbowl

Simulating evolution of fish intelligence in a fishbowl using neuroevolution / genetic algorithms.

See it in action: https://leshchenko1979.github.io/fishbowl/

How it works

The fish

The fish are placed in an aquarium with a randomly initiated neural network serving as their brain. The fish grow by consuming the food they bump into.

The fish can:

However, every cycle the fish expend their energy (and lose their weight) on thinking, breathing etc. - and even more so when they move. When the fish is too small, it dies, turning into food.

The food

The fishbowl also contains food (plankton), which grows on its own and splits into two pieces when it's big enough.

The simulation

The program will run the simulation until all the fish but one die. At this point the simulation resets and another generation of fish is put in to the fishbowl, derived from the most successful fish from the previous generation.

You can witness the changes in the fish behaivor as the neural network evolves. The evolution is also shaped by the initial food amount and the duration of the simulation of each generation.

Features

How the fish brain works

The fish brain uses LiquidCarrot package which is a Javascript implementation of the NEAT algorithm for fast neuroevolution and self-developing neural network topology.

Inputs of the fish brain

Outputs of the fish brain

One node containing the rotation angle of the fish.

Observed evolutionary phenomena