Cilium - An artificial life simulator

In summary: Chrome)In summary, the project is in its early stages, but it looks like it has a lot of potential. The fluid solver is particularly impressive, and it looks like it will be possible to evolve organisms to learn.
  • #1
voodooattack
12
8
Here is something that I've been working on for the past two weeks, it's in its early stages, although I've done a lot of work.

Fair warning: this is really CPU intensive and will crush anything short of an i7. Do not open it with a handheld!

http://cilium.codebuffalo.com/

Please check it out and tell me what you think, and if you can help me with the liquid simulation (pressure/drag equations), I would love to hear from you. The fluid mechanics are half-working right now. I have an implementation of the Navier-Stokes equations (particularly a Stam solver) in place; but my own rigid-body physics integration with Chipmunk is terrible.

If you come across any organisms that exploit bugs in physics, please post the genomes.

Here is a screenshot of a simulation in progress and the new brain viewer that I've just implemented (WIP):

https://dl.dropboxusercontent.com/u/27714141/cilium5.png
 
Last edited by a moderator:
  • Like
Likes Medicol
Technology news on Phys.org
  • #3
Thanks.

Here's an excerpt I posted elsewhere that will help everyone understand what's going on:

The organisms you see are swimming in fluid (the red/green/yellow hues represent fluid velocity around them), all organisms are controlled via spiking artificial neural networks. All body parts (logical and physical) have underlying neurons.

Here is a list of the currently enabled body parts:
* Flagella: motorised appendages and contact sensors. Organisms sense through and control each segment independently. (Segments turn red on contact)
* Cilia: pressure and contact sensors. Can sense current liquid pressure, with some work an organism could use them to sense vibrations. (Normally a teal circle that turns yellow on contact)
* Nematocysts: projectile launchers, can launch green projectiles that damage health. (Red circles, bugged at the moment)

Logical parts:
* Neuron: a spiking model, and that means that they can fire at will. Basic neurons have 1 channel, other body parts can have multiple.
* Controller: provides the organism with statistics/identity stuff (energy health, velocity, heading, etc) and causes the organism to reproduce when excited (provided enough energy is present).

All organisms start with 1000 energy minus a cost per body part, and they can replenish it by touching dead organisms that have surplus energy.
 
  • Like
Likes Superposed_Cat and Medicol
  • #4
I think I finally got fluid drag right!

 
  • Like
Likes Superposed_Cat and Greg Bernhardt
  • #5
That's an awesome simulation.Their hairs look still kind of stiff. Would you mind telling us what people may learn from you project's simulation model ?
If you come across any organisms that exploit bugs in physics, please post the genomes.
OK here is a firebug's
http://www.genomesize.com/result_species.php?id=3965
 
  • #6
Lizabella said:
That's an awesome simulation.Their hairs look still kind of stiff. Would you mind telling us what people may learn from you project's simulation model ?

Thank you. They look stiff because they're represented by segmented chains of straight lines in the physics engine. It can be made more smooth by decreasing the length and increasing the segmentation.

What people may learn is, in the end, up to them; but the basics of evolution, how neural networks work, and emergent behaviour are some of the highlights.

Lizabella said:

Well, that certainly would cause a bug in the simulation. :D
 
  • Like
Likes Lizabella
  • #7


This version includes many, many fixes and optimisations! I also separated synapses into two categories: logical and mechanical. Logical synapses connect neurons to neurons, while mechanical ones are used as inputs for physical parts.

This allows physical parts to freely act as regular neurons while still maintaining their inputs from the underlying neural network.

Another piece of work is the stack machine. Now every organism has a small stack machine operating in the background. It can adjust the neural network, alter weights, create and delete synapses, and control reproduction. What this means is that organisms can now evolve to learn. I plan to make it so that the stack machine can create and delete body parts to facilitate developmental encoding (growth).

Now I need to work on the PHP side and add the genome exchange functionality. This will essentially connect all running simulations to a central database. The users will be able to exchange the most successful genomes. I'm really excited at the prospect.
 
  • #8
Organisms can now read and modify their own genome, and it will carry on to their offspring. I reduced the default mutation rate as a result.

Here's an example, the organism's stack machine was overwriting (or inserting into) the genome at offset 0.

Code:
GCAGCAGCAGCAGCAGCAGCAGCAGCACCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCA
GCAGCAGCAGCACTAGCAGCAGCAGCAGCAGCAUUTGCAGCAGCAGCAGCAGCAAGTGCAGCAGCAGCAGCA
GCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGGGGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCA
GCAGCAGCAGCAGCAGCAGCAGCAGCACCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCA
UCUGCAGCAAUTGCAGCAGCAGCAGCAAGGGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCAGCA
GCAGCAGCAGCAGCAGCAGCAGCAUCCGCAAGCGCAGCAGGTGCAGCAGCACAAGCAGCAGCAGCAGCAGCA
AUCGCAGCAGCGGCAGCAGCAGCAGCAGCAGCAGCAGCACAUGCAGCAGCAGCAGCAGCAUTCGCAGCAGCA
GCATGUCGGGGCGGCTATTGTGGCAUUAUAGTUACTACTCCGAUUGGCTGTACTGGCTGTACTTTACTGTGT
GGCGTAAUUAUUATACCGGGCTCGTGTGGCAUUACTTGTGUUACTTGACCGTGTCCGTGTGGCACTAUUUGT
CCGAUUGGCTGTGGCTGTATCTGTCUAAAAAUUACUGGCCCGACTCCGAGCTGTAUUAUUGGCACTACTAUU
ACTACTGATAGAACTCUCGGCCCGTGTGGCUUAGGCACTGGCGGCAUUGACACTUACTGTACTCGCAUUAUU

Full genome: http://pastebin.com/icYYLZKu

What this means:

1. Genetic memory.
2. Polymorphism.
3. An organism could in theory create an entirely different organism.. viruses? Maybe when I add more body variation and injectosomes.

Also, here's an interesting video of the fluid solver in action:

https://dl.dropboxusercontent.com/u/27714141/cilium8.webm
https://dl.dropboxusercontent.com/u/27714141/cilium8.webm

(I wish I could embed WebM directly here)
 
Last edited by a moderator:
  • Like
Likes thankz and Greg Bernhardt
  • #9
What are the length scales of your project? I can help you with the equations. If the Reynolds number is order 1, you can approximate drag using the "stokes drag" equation. Its pretty easy to program. If your on the micrometer scale, you may need to take into account the saffman lift force. This is actually pretty complicated to understand conceptually and in more than 1 dimension is not as easy to program. If you're on the nanometer scale then you cannot neglect Brownian motion. You can use a Monte Carlo method to approximate its effects for a spherical object.

A good read for you might be "life at low Reynolds number". Its a good paper in conversational format on the physics of flows at the bacterium scale.You could also solve the 2D navier stokes (simplified to neglect the advection terms) equations, but honestly unless your project is for CFD you will take up too much memory and time properly meshing your domain.
 
  • #10
HuskyNamedNala said:
What are the length scales of your project? I can help you with the equations. If the Reynolds number is order 1, you can approximate drag using the "stokes drag" equation. Its pretty easy to program. If your on the micrometer scale, you may need to take into account the saffman lift force. This is actually pretty complicated to understand conceptually and in more than 1 dimension is not as easy to program. If you're on the nanometer scale then you cannot neglect Brownian motion. You can use a Monte Carlo method to approximate its effects for a spherical object.
A good read for you might be "life at low Reynolds number". Its a good paper in conversational format on the physics of flows at the bacterium scale.
You could also solve the 2D navier stokes (simplified to neglect the advection terms) equations, but honestly unless your project is for CFD you will take up too much memory and time properly meshing your domain.
All units are arbitrary at this point. I use Chipmunk2D for physics and a stokes solver for fluid dynamics and a bit of glue I wrote myself in-between to approximate drag.

The navier-stokes implementation is a bit slow, so the resolution for the solver can't exceed 64 (or 10x7.5 pixels per fluid cell). It's a Stam solver modified to include vorticity confinement. My only issue is approximating the right viscosity and diffusion values (parameters for the solver) right now.

I'd like to add Brownian motion. The problem is with flagella and the such, which can't be approximated the way you describe.

I've read 'life at low reynolds number', it's quite good. Although some of the equations fly straight through my head. :)
 
  • #11
If your resolution is that low then NS might not even work. Check your knudsen number. Usually continuum models cannot be applied when Brownian motion is not negligible. So you might want to take a look at diffusion models that don't use or limit continuum approximation.

Again, your length scales have to be O(10^-9) for these considerations to be valid.
 

1. What is Cilium?

Cilium is an artificial life simulator that allows users to create and manipulate virtual organisms in a simulated environment. It is designed to mimic real-life biological systems and study their behaviors and interactions.

2. How does Cilium work?

Cilium uses algorithms and models based on biological principles to simulate the growth, reproduction, and evolution of virtual organisms. Users can control the environment and parameters to observe how different organisms react and evolve.

3. What can Cilium be used for?

Cilium can be used for educational purposes to help students understand concepts in biology, evolution, and ecology. It can also be used for research purposes to study the behavior and evolution of different organisms in a controlled environment.

4. Is Cilium scientifically accurate?

While Cilium is based on real-life biological systems, it is still a simulation and may not always accurately reflect the complexities of the natural world. However, it can provide valuable insights and serve as a useful tool for studying and understanding living systems.

5. Can I customize the organisms in Cilium?

Yes, Cilium allows users to create their own organisms by adjusting various parameters such as size, shape, and behaviors. Users can also introduce mutations and select for certain traits to observe how it affects the evolution of their organisms.

Back
Top