Architecture of an Artificial Life Sim

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
AndrewMicallef
Prole
Posts: 7
Joined: Wed Apr 29, 2020 2:37 am

Architecture of an Artificial Life Sim

Post by AndrewMicallef »

---
Edit: Current love file
lovesriptsbots_v0.0.05.w.love
A working demo of where I am at with my current framework. select an object with RMB, drag with LMB. The cyan circle is an enzyme. If you have it selected you can attache to a membrane segment with `w` and cut that segment with `q`
(1.39 MiB) Downloaded 301 times
A working demo of where I am at with my current framework. select an object with RMB, drag with LMB.
The cyan circle is an enzyme.
If you have it selected you can attach to a nearby membrane segment with `w` and cut that segment with `q`
---

Hi there,

I'm currently working on making an artificial life simulation. At the moment I'm focusing on getting some fun / consistant mechanics around the behaviour of a single cell and it's components. The long term goal is that the cell will be controlled by an artificial neural network, which hopefully, if the mechanics are rich enough, will evolve (learn) to do some interesting things. In particular I want to make it at least possible for endocytosis to occur:

Image

To get there has been a bit of a challenge, both for me to conceptualize and to explain. In order to aid my explanation I am including a link to my most current working copy. Current git repo. In addition I made a couple of videos where I try to explain what I'm up to here and here.

So at the moment my code defines a softbody cell, which is composed of a bunch of linked MembraneSegments. These segments each have two anchors (I may also refer to these as bindingsites). An anchor can attach either to another MembraneSegement or to an Enzyme (in my code I am calling this an Organelle, I think in the future I want Enzyme to be a sub-class of Organelle.
The Enzyme can attach to and break existing bonds. It can also drag the bound MembraneSegment around, ultimately with a view to reshaping the boundary of the Cell. Ie with three Enzymes coordinating their action I should be able to create a vesicle as in the above image. So far all that functionality looks like this: https://love2d.org/imgmirrur/vJJkdPp.mp4

So far everything is all well and good. I mean there are a few things I could make more efficient, but in terms of the broad prototype I'm happy enough with it. However, adding additional features is starting to get slow, and I'm wondering if a conceptual overhaul may be what is required.

To that end I recently sat down and sketched what I think my programs basic building blocks are, molecules + bindingsites.

molecule concept
Image

So my basic building block is the molecule, which would just be a circular physics object. It has a size (radius), position, and body + shape + fixture. It also would, optionally include 1 or more binding sites, where it can form an attachment to another molecule.
The binding sites are themselves a special type of molecule. Their fixtures would be set to "sensor" and they would be fixed to the parent-molecule body (side note would it make sense for them to be 'static' bodies in this instance?).
The binding site would have a bunch of methods for creating and destroying joints, and for checking what type of molecule it is in contact with (bonds may only form between certain molecular pairs).

class
Image

Image


Using the above building blocks I might define my membrane segment as a pair of molecules which are linked together. Further, a group of N- linked membrane segments would define a new cell object. As illustrated below.

cell def
Image

Finally an enzyme for cutting the membrane would be a pair of interacting molecules. The Enzyme would come in two parts, A & B. Both A & B would attach to neighbouring segments of a cell, and the Enzyme would have a method for breaking the bonds between those segments.
Thus a pair of enzymes (two A units and two B units) could coordinate to insert / remove sections of a membrane.

Image


So I guess what I'm looking for is feedback on the overall architecture of my code. Otherwise I'm open to any additional thoughts you might have if you have stuck with me to here. This project is likely to take me a long time, I work full time, and have ordinary life things to do otherwise. This is in part why I want to get the framework down pat, so that I can focus on coding the fun stuff, and not pull my hair out everytime I try to make a small modification.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 54 guests