Evolving Creatures

A Simulation of Evolutionary Process using Genetic Algorithm

The project aims to perform evolutionary process of creatures in a simulated environment. The implementation is largely based on a paper by Karl Sims (1994).
Python
AI
Author

Hanzholah Shobri

Published

February 2023

Status :

On Progress

Contributor(s) : Hanzholah Shobri Github, LinkedIn, Twitter
Repository : https://github.com/hanzholahs/evolving-creatures

Description

The project is a simplified implementation of evolving virtual creatures by Sims (1994), inspired by the lecture on bio-inspired computing within Artificial Intelligence module from University of London.

Objectives and limitations

The project aims to implement the evolving virtual creatures described in (Sims 1994) and simulating the evolutionary process of the virtual creatures over several generations to come up with unique individuals that can perform a specific task defined as the fitness.

This requires the capability of the program to:

  • transform a sequence of numbers (representing genotype) which was initally generated randomly, and represent this sequence into a virtual creature that can act in a simulated environment by a physics engine (representing phenotype).
  • run the creatures within a simulation environment and evaluate their fitness based on a specified function.
  • perform genetical manipulation of the creatures to generate subsequent generation based on the fitness of the population. These include the selection of fittest parents, crossover parents’ dna and mutation of creature genes.

Some adjustments to the implementation of evolving virtual creatures by Sims (1994) were made.

  • Sensors, internal neural nodes, and effectors to control the creatures from the original paper are not covered in this implementation. Instead, the more straightforward control mechanisms are defined, which constitute pre-defined functions to specify the speed of the body parts movements based on the joint types.
  • It is not possible for a body part to be connected with two or more different body parts with different genotype. If there is four genotypes connected with each other, each body type defined by its genotype is connected only to other parts from two other genotypes at maximum.
  • The behavioural selection used was only walking. The fitness of a creature is based on the distance. This means that the genes of creatures with the longest distance traveled are more likely to survived for the next generation. Simpler creatures are preferred so that there is a penalty for each creature with larger number of body parts.

Technology

The project leveraged several Python libraries, including pybullet as the physics engine and numpy which is the backbone of genes manipulation.

References

Sims, Karl. 1994. “Evolving Virtual Creatures.” In Proceedings of the 21st Annual Conference on Computer Graphics and Interactive Techniques - SIGGRAPH ’94, 15–22. ACM Press. https://doi.org/10.1145/192161.192167.