Edit: Current love file 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:
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](https://love2d.org/imgmirrur/BTLHTtA.jpg)
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](https://love2d.org/imgmirrur/SQlE4of.jpg)
![Image](https://love2d.org/imgmirrur/ar7LpJr.jpg)
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](https://love2d.org/imgmirrur/DUZMrxl.jpg?1)
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](https://love2d.org/imgmirrur/4U2hkDt.jpg)
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.