This application allows the user to witness the activity of a virtual microbial community.
==============================
. o o o
. + .
+ o + + .
o + + o o
+ o . + o .
o ! + ! o
+ + + o
+ + . + +
o + . ! !
! o . . o
==============================
Name: Simulation 1
Size: 10x10
Microorganisms: 45
Dead Microorganisms: 55
Total Energy: 1858
Ticks elapsed: 16 of 120
- Install Docker
- Clone the repository
- Open the project in VSCode.
- Install the Remote-Containers extension.
- Click on the green button in the bottom left corner of the window.
- Select "Reopen in Container".
- Open a terminal in VSCode.
- Run the
./run_tests.shscript or build the tests withmake testsand run them with./mb_tests.
- Install Docker and Docker-Compose
- Clone the repository
- Open a terminal in the root directory of the repository
- Run the following command:
docker-compose up --build --remove-orphans
- Install Docker
- Clone the repository
- Open the project in VSCode.
- Install the Remote-Containers extension.
- Click on the green button in the bottom left corner of the window.
- Select "Reopen in Container".
- Open a terminal in VSCode.
- Run the
./cr.shscript or build the project withmakeand run it with./mb_app.
The webapp target builds a small Ulfius-based web server (mb_webapp) that runs the simulation continuously and serves a live view of it.
With Docker Compose:
- Run
docker-compose up --build microbiome-webapp - Open http://localhost:8080 in a browser
Building locally (in addition to make g++, this needs libulfius-dev and pkg-config, e.g. apt-get install pkg-config libulfius-dev on Debian/Ubuntu):
- Run
make webapp - Run
./mb_webapp(setMICROBIOME_WEB_PORTto use a port other than the default 8080) - Open http://localhost:8080 in a browser
The page polls GET /api/state a few times a second for the current grid, microorganisms, and biomatter as JSON, and once the population goes extinct the server starts a new generation automatically.
The Microbiome class represents a virtual microbial community. It is an extension of the Environment class provided by env-lib-cpp. Within the microbiome, there are a number of microbes that are able to interact with each other and the environment. The Microbiome class is responsible for managing the microbes and the environment they exist in.
The Microorganism class represents a single microbe. It is an extension of the Entity class provided by env-lib-cpp. The Microorganism class is responsible for managing the microbe's energy and metabolism.
The Biomatter class represents decomposing biomass left behind when a microorganism dies. It is an extension of the Entity class provided by env-lib-cpp. Living microorganisms bias their movement toward it (chemotaxis) and can forage it for energy, modeling nutrient recycling instead of dead microorganisms simply vanishing from the energy budget.
The WebServer class (built on Ulfius, see #19) runs a Microbiome simulation continuously in the background and exposes its state over HTTP, so it can be viewed live at http://localhost:8080 instead of only in the console.
See RESEARCH.md for the microbiology background behind these mechanics and what's still missing.
- Metabolism - every microorganism loses energy each tick and dies once its energy reaches zero.
- Decomposition - a dead microorganism's biomass becomes Biomatter in the environment rather than an inert corpse.
- Chemotaxis - microorganisms bias their movement toward neighboring locations that have Biomatter, rather than moving with pure uniform randomness.
- Foraging - a microorganism sharing a location with Biomatter can consume it for energy, depleting it over time.
- Reproduction - a microorganism that accumulates enough energy divides via binary fission into two daughter cells, each inheriting half its remaining energy (minus the energetic cost of dividing) and its metabolic rate.
This project is licensed under the Preponderous Non-Commercial License (Preponderous-NC).
It is free to use, modify, and self-host for non-commercial purposes, but commercial use requires a separate license.
Disclaimer: Preponderous Software is not a legal entity.
All rights to works published under this license are reserved by the copyright holder, Daniel McCoy Stephenson.
Full license text:
https://github.com/Preponderous-Software/preponderous-nc-license/blob/main/LICENSE.md