#mutation #genome #grid #growth #habitat #plant

bin+lib treevolution

A simulation of the evolution of treelike structures in a cellular automata

4 releases (2 stable)

new 1.0.1 Mar 13, 2025
0.1.1 Dec 25, 2024
0.1.0 Dec 25, 2024

#54 in Simulation

Download history 239/week @ 2024-12-22 8/week @ 2024-12-29 3/week @ 2025-01-05 197/week @ 2025-03-09

197 downloads per month

MIT/Apache

43KB
907 lines

Treevolution

Overview

This crate is about a hobby project of mine, published with the hopes that someone finds it as interesting as I do. It's all about the simulation of plant growth and mutation. I am using a real simulated genome which gets altered by mutation. In this first Version you can hopefully see the potential of this simulation, but keep in mind that it is far from done.

Usage

The usage is very simple, first a new habitat needs to be created, the only parameter needed is the size of the grid:

let mut habitat = Habitat::new(IVec2::new(256, 32));

After that you want to set a minimum plant count for your habitat, so you dont have to spawn the first plants by hand:

habitat.set_minimum_plants(20);

The only thing left is to call the habitats update() function in a loop, each update represents one time step.

Parameters

I have built in a lot of adjustable hyperparameters, e.g. for controlling energy gain/consumption or lifetime of plants. There are currently around 20 parameters with a lot more to come. I am planning to make them openly changeable and better documented, because seeing the impact of different environment constraints is one of the main reasons i am working on this project.

Potential Extensions

  • a gravity-like constraint
  • mouse support for the included grid window (selecting plants and cells)
  • a kind of debugging to see the "stats" of different plants
  • a lot of new constraints to play around with

Dependencies

~15MB
~333K SLoC