All Projects → MaxRobinsonTheGreat → LifeEngine

MaxRobinsonTheGreat / LifeEngine

Licence: GPL-3.0 license
The Life Engine

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to LifeEngine

Pygmo2
A Python platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
Stars: ✭ 134 (-51.09%)
Mutual labels:  evolutionary-algorithms
Evolutionary Computation Course
Jupyter/IPython notebooks about evolutionary computation.
Stars: ✭ 173 (-36.86%)
Mutual labels:  evolutionary-algorithms
datafsm
Machine Learning Finite State Machine Models from Data with Genetic Algorithms
Stars: ✭ 14 (-94.89%)
Mutual labels:  evolutionary-algorithms
Evolutionsimulator
Evolution Simulator with Box2D
Stars: ✭ 143 (-47.81%)
Mutual labels:  evolutionary-algorithms
Gym Fx
Forex trading simulator environment for OpenAI Gym, observations contain the order status, performance and timeseries loaded from a CSV file containing rates and indicators. Work In Progress
Stars: ✭ 151 (-44.89%)
Mutual labels:  evolutionary-algorithms
Watchmaker
The Watchmaker Framework for Evolutionary Computation
Stars: ✭ 189 (-31.02%)
Mutual labels:  evolutionary-algorithms
Novelty Search Live
Musical Novelty Search: Evolutionary Algorithms + Ableton Live
Stars: ✭ 75 (-72.63%)
Mutual labels:  evolutionary-algorithms
machine-learning-blackjack-solution
Finding an optimal Blackjack strategy using AI
Stars: ✭ 40 (-85.4%)
Mutual labels:  evolutionary-algorithms
Evoskeleton
Official project website for the CVPR 2020 paper (Oral Presentation) "Cascaded Deep Monocular 3D Human Pose Estimation With Evolutionary Training Data"
Stars: ✭ 154 (-43.8%)
Mutual labels:  evolutionary-algorithms
Optimized-MDVRP
"Using Genetic Algorithms for Multi-depot Vehicle Routing" paper implementation.
Stars: ✭ 30 (-89.05%)
Mutual labels:  evolutionary-algorithms
Bluepyopt
Blue Brain Python Optimisation Library
Stars: ✭ 143 (-47.81%)
Mutual labels:  evolutionary-algorithms
Evomaster
A tool for automatically generating system-level test cases. Currently targeting REST APIs.
Stars: ✭ 151 (-44.89%)
Mutual labels:  evolutionary-algorithms
Evostra
A fast Evolution Strategy implementation in Python
Stars: ✭ 227 (-17.15%)
Mutual labels:  evolutionary-algorithms
Evolutionary.jl
Evolutionary & genetic algorithms for Julia
Stars: ✭ 142 (-48.18%)
Mutual labels:  evolutionary-algorithms
SimpleGP
Simple Genetic Programming for Symbolic Regression in Python3
Stars: ✭ 20 (-92.7%)
Mutual labels:  evolutionary-algorithms
Yabox
Yet another black-box optimization library for Python
Stars: ✭ 103 (-62.41%)
Mutual labels:  evolutionary-algorithms
Sparse Evolutionary Artificial Neural Networks
Always sparse. Never dense. But never say never. A repository for the Adaptive Sparse Connectivity concept and its algorithmic instantiation, i.e. Sparse Evolutionary Training, to boost Deep Learning scalability on various aspects (e.g. memory and computational time efficiency, representation and generalization power).
Stars: ✭ 182 (-33.58%)
Mutual labels:  evolutionary-algorithms
ldca
Self-replicating, self-modifying Assembly program that can evolve into every possible computer program in the universe (EXPERIMENTAL)
Stars: ✭ 43 (-84.31%)
Mutual labels:  evolutionary-algorithms
ruck
🧬 Modularised Evolutionary Algorithms For Python with Optional JIT and Multiprocessing (Ray) support. Inspired by PyTorch Lightning
Stars: ✭ 50 (-81.75%)
Mutual labels:  evolutionary-algorithms
Circle Evolution
Evolutionary Art Using Circles in Python
Stars: ✭ 237 (-13.5%)
Mutual labels:  evolutionary-algorithms

This is the readme for my evolution simulator, The Life Engine.

FOR FEATURE REQUESTS, USE THE DISCUSSIONS TAB. FOR BUG REPORTS, USE THE ISSUES TAB. :)

The Life Engine

Play here!

The life engine is a cellular automaton designed to simulate the long term processes of biological evolution. It allows organisms to eat, reproduce, mutate, and adapt. Unlike genetic algorithms, the life engine does not manually select the most "fit" organism for some given task, but rather allows true natural selection to run its course. Organisms that survive, successfully produce offspring, and out-compete their neighbors naturally propogate througout the environment.

This is the second version of the original evolution simulator, which I started in high school.

How to Run and Modify the Code

  • Install node and npm
  • Download or clone this repository
  • Open a terminal or powershell comand prompt, go to the repository and run npm install
  • Run npm run build (or npm run build-watch for a better developer experience)
    • If you get a Can't resolve jquery error message run npm install --save jquery
  • Open dist/index.html in your browser. The simulation should start running.

To load custom creations (found in /dist/assets), you must have a simple web server that serves all files in the dist directory. I do this with python:

  • Install python
  • run python -m http.server --directory dist from the repository root
  • Open http://localhost:8000/ in your browser

Npm build commands

  • Production mode (minified): npm run build
  • Watch mode (dev mode that auto-builds when you save a file): npm run build-watch
  • Dev mode (better error messages): npm run build-dev

How the Simulation Works

The Environment

The environment is a simple grid system made up of cells, which at every tick have a certain type. The environment is populated by organisms, which are structures of multiple cells.

Cells

A cell can be one of the following types.

Independent Cells

Independent cells are not part of organisms.

  • Empty - Dark blue, inert.
  • Food - Grayish-blue, provides nourishment for organisms.
  • Wall - Gray, blocks organisms movement and reproduction.

Organism Cells

Organism Cells are only found in organisms, and cannot exist on their own in the grid.

  • Mouth - Orange, eats food in directly adjacent cells.
  • Producer - Green, randomly generates food in directly adjacent empty cells.
  • Mover - Light blue, allows the organism to move and rotate randomly.
  • Killer - Red, harms organisms in directly adjacent cells (besides itself).
  • Armor - Purple, negates the effects of killer cells.
  • Eye - Light purple with a slit, allows the organism to see and move intelligently. See further description below.

Organisms

Organisms are structures of cells that eat food, reproduce, and die. When an organism dies, every cell in the grid that was occupied by a cell in its body will be changed to food. Their lifespan is calculated by multiplying the number of cells they have by the hyperparameter Lifespan Multiplier. They will survive for that many ticks unless killed by another organism. When touched by a killer cell, an organism will take damage. Once it has taken as much damage as it has cells in its body, it will die. If the hyperparameter One touch kill is on, an organism will immediatly die when touched by a killer cell.

Reproduction

Once an organism has eaten as much food as it has cells in its body, it will attempt to reproduce. First, offspring is formed by cloning the current organism and possibly mutating it (see below). The offspring birth location is then chosen a certain number of cells in a random direction (up, down, left, right). This number is calculated programmatically such that it is far enough away that it can't intersect with it's parent. Additionally, a random value between 1 and 3 is added to the location to introduce a little variance. Reproduction can fail if the offspring attempts to occupy non-empty cells, like other organisms and food. If reproduction fails, the food required to produce a child is wasted.

Mutation

Offspring can mutate their anatomies in 3 different ways: change a cell, lose a cell, or add a cell. Changing a cell sets a random cell to a random type. Losing a cell removes a random cell. Note that this can result in organisms with "gaps" and cells disconnected from the rest of its body. I consider this a feature, not a bug. To add a cell the organism first selects a cell it already has in its body, then grows a new cell with a random type in a location adjacent to the selected cell.

If an organism mutates, there is a 10% chance that mutation will alter the movement patterns of the organism (see below).

Movement and Rotation

Organisms with mover cells (light blue) are permitted to move freely about the grid. Only a single mover cell is required and adding more doesn't do anything. By default, an organism selects a random direction and moves one cell per tick in that direction for a certain number of ticks. This number is called "Move range", and it can mutate over time.

Organims can also rotate around a central pivot cell. This cell can never be removed by mutation, though it can change type. Movers rotate randomly when they change direction, and their rotation is not necessarily the same as their movement direction, ie, they aren't always facing the direction they are moving. Offspring of all organisms (including static ones) rotate randomly during reproduction. This rotation can be toggled in the simulation controls.

Eyes and Brains

Any organism can evolve eyes, but when an organism has both eyes and mover cells it is given a brain. The eye, unlike other cells, has a direction, which is denoted by the direction of the slit in the cell. It "looks" forward in this direction and "sees" the first non-empty cell within a certain range. It checks the type of the cell and informs the brain, which then decideds how to move. The brain can either ignore (keep moving in whatever direction), chase (move towards the observed cell), or retreat (move in the opposite direction of the observed cell). The brain maps different observed cell types to different actions. For instance, the brain will chase when it sees food and retreat when it sees a killer cell. These behaviors can mutate over time.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].