CPA Prototype

I haven’t got to predator prey relationships yet. All that’s happening is the microbe is absorbing compounds form it’s environment, processing them, locking them away in it’s locked bin and then spilling them from there back into the environment. What should happen (I think) is that everything should settle into an equilibrium where the rates of these processes are balanced (like the species is growing as fast as it is dying so it’s population is stable etc).

I think I’ll try making a prototype with just one compound. I think that will make things easier, no processes. Just growth and death in a patch. I’ll let you know how that goes. Once that’s done it’ll be easier to see how to extend it to many compounds.

Thanks for the offer of help! I’ll let you know.

The first rule of problem solving is “If you can’t solve the problem solve an easier one”. In light of that I wrote a quick program to do the CPA with just 1 compound. Here’s the results. You can see that the population stabilises to a constant where it’s absorbtion = it’s death rate. Next I’ll try adding predation.

With predation it’s still shockingly stable. That’s kind of bizarre. I guess I was imagining there might be more limit cycles (where the populations fluctuated over time). Still pretty cool I guess, a good basis for building on. Code in the repo.

In this top image you can see the species that starts with the least compound locked (they all start with a random amount) just munches his way through the others and ends up on top.

1 Like

Bit of progress today. I managed to get the multi-compound sim to work. Which is nice. Bad news all the species just die out exponentially.

However if you artificially stabilise them with fat and protein (which currently are the only things they are made of) they do fine.

1 Like

If you can take a look at total compounds (locked + free), what’s happening? are compounds disappearing, effectively starving the ecosystem?

What list of processes are you using (if you aren’t already, I suggest this one)?

Yes that’s a good idea. I’ll make some kind of accounting function which checks there isn’t a leak. I’ve been using my old compounds and processes list from the old forum.

I think we should bite the bullet and fix a final compounds and processes list. Is there any reason we can’t do this now? I think it will be important to actually balance the equations to avoid accountancy problems with creation or destruction of compounds.

The accounting is actually quite complicated. The reason being that because compounds are transformed it’s not trivial to work out if stuff is disappearing. The results are a little better though.

Huh you can ctrl v a screenshot straight into a post. That’s kind of cool.

Anyway I think I want to start again with a proper compounds and processes list. It gets complicated really fast. It needs more accounting built in. I’ll make a new thread.

1 Like

That’s the logic that led me to produce the list I linked :stuck_out_tongue:. In these equations I made sure to keep carbon balanced, ignored the production and incorporation of water since the amount of water turned over through chemical reactions is always very small compared to the amount of water a cell requires for all sorts of other reasons (ie, a scenario where water is a limiting factor in a reaction is a scenario where the cell has a whole lot of other problems), and used ATP not so much as a chemical compound, but as a unit of energy accounting, to quantify the number of ATP-equivalent units of energy usably produced, or required, by each reaction.

So, for example, you will note that the fat reactions don’t preserve pyruvate, but that’s ok since carbon is preserved, and excluding photosynthesis, ATP is generally lost in reaction cycles, as it should be, since the Gibbs potentials are what drive these reactions in a certain direction in the first place.

How are you driving reaction rates? I imagine you are doing a simple rate law thing. This is a problem with the current game too, since reaction rates in living cells are controlled heavily by gene expression, ligands, etc, and are thus not simply driven by the quantities of each reactant and product. The question is, how do we quantify those regulating factors?

Stable populations whooop. This is with birth and death so they are able to absorb compounds from the environment, process them into protein and fat, make more of themselves with protein and fat and then have those members die (spilling the protein and fat back into the patch).

This is what it looks like with bacteria processing spilled compounds !!! HYPE!

1 Like

It seems over a long time the populations become very stable. There is the initial transient period and then they stabilise so fixed values, just like in the one compound example.

I guess part of this is they just burned through all the Hydrogen Sulphide and then once that was gone they relied on photosynthesis alone.

Ok so I put in an Ocean Stabilisation routine which basically sets an ocean wide value for a compound and over time moves the amount in the patch towards that value. For example it will mix sulphur made by the microbes away to nothing and replenish the hydrogen sulfide (assuming they live near an ocean vent). What this means is that if the microbes are net producers of something (like fat) then they can’t just build it up and sort of store it in the patch. Here are the results.

2 Likes

That looks fantastic! Amazing job. I particularly love how it’s a periodic function. So population goes up and uses up all the compounds, and then everyone starts to die, releasing more compounds. Awesome.

If I may ask, are the reaction rate dependent on concentrations as you and moopli were talking about, or are they constant? Or have you not gotten to that point yet?

Thanks. The reaction rates are based on the thresholds idea we were discussing. So if a compound is below it’s lower threshold the process that produces it will start going. If it’s above it’s high threshold any process that uses it as an input will start working and if it’s above it’s vent threshold then it gets vented. I made a typo, I typed a1 - b rather than a(1 - b) and I think it’s probably the best thing I’ve done on this project. If a compound is low then it will try to start the process that produces more but if the inputs to that process are also low that process will slow down. So if you’re low on everything the cell will do nothing rather than running all processes trying to correct all the deficiencies. It works beautifully and was a complete accident.

Code is in the repo if you want to have a look. The “step_function” function determines the response to being above or below the thresholds which is stored as compounds_free_action. Then “run_organelles” just searches for the largest of these.

Nice. Now, if I were to implement this, how exactly does the interface work? I mean, what information do I need to supply (if any) to the CPA system and what data does it output? You mentioned that there are bacteria processing spilled compounds, are these just “internal” bacteria (a vague species being that process a certain amount of X into Y every second), or actual discrete entities?

The reason I’m asking is that I believe it was decided that the CPA system dictates how often we see each microbe and bacteria species. This, in turn, tells us what compound clouds are being produced and in what amount.

I understand if you’re not at this point yet—you’ve done a huge amount already—I was just curious.

Interesting questions.

Basically the interface is all output. We’ll need a really clear way of representing what species are in your patch and how well they are doing relative to each other. This is a really good data visualisation challenge, you can see from the prototype there is so much information it’s easy for the graphs to be unreadable.

The input is choosing what organelles your species has in the editor. This is the only control you have over your species in the CPA system. The hope is the models will be good enough that you will choose what works for you swimming around and that will translate into doing well in CPA. I guess if the processes are the same in the CPA and swimming around then you should get a good feel for that part of it.

The bacteria were a cleanup mechanism, so if you spill protein they chew it up to prevent species living as scroungers. However that’s not really necessary anymore. The Ocean Stabilisation will handle that just fine so actually bacteria probably need a rethink. They could just live alongside you in your patch, they could have a specific role, we’ll have to think it through.

Bacteria, in the game stage, are for more than just preventing things from accumulating in the environment – they add more stuff to interact with and swim between, what with the plans to have myriad types of large bacterial colonies that form particles you have to swim around, or webs of cyanobacteria-like filaments you can swim between.

Also, if you’re planning on keeping the ocean stabilization mechanism, how will we handle, say, mass oxygenation events, or other things where the biosphere should drastically change levels of some compound, when we’re putting our thumbs on the scales to artificially stabilize things? I don’t think we can keep the ocean stabilization as more than just a stopgap :confused:

I was thinking about that. So basically the way it works now is that, for each compound, there is an ocean level and every step the level in the patch is moved 1% closer to the ocean level. How about just moving the ocean level 0.01% towards the patch level at the same time? (Or some other, smaller, fraction which represents the ratio of the mass of the patch to the mass of the ocean). That would keep track very nicely of the effect the microbes were having on the ocean. Moreover it would allow some transport between patches, if the ocean level of O2 starts at 0 but one patch is a net producer then slowly the whole ocean will start to oxygenate.

I figure that would be pretty elegant for what we want to do.

We could even just add an “Atmospheric Stabilisation” where each turn the atmosphere and the ocean move towards each other 0.01% (of course only gasses would be in the atmosphere, not protein! (though I used to work in a Pizza Hut and it’s atmosphere was like 25% pepperoni by mass)).

I like that idea, it’s good to have a buffer for the non-biological compounds. We could even add some implicit processes which cause biological material (say, ATP, etc) outside living organisms to chemically break down as time passes – simply make sure that when they break down they decompose into constituent compounds at a good ratio, and you’re golden. Together, those would basically be the ocean-stabilization system you have going, just with some more nuance.

1 Like

From another thread “Also, the cell still stockpiles CO2, which sometimes kill you since you don’t have any room for oxygen, so keep that in mind.”

Under the threshold system, there is a low threshold where the microbe will try to absorb compounds, a high threshold above which it will try to use up compounds and a vent threshold above which the microbe will just vent the excess instantaneously. This means stockpiling is no longer a problem as each compound has it’s own set of thresholds.

The problem this raises, however, is how to relate the thresholds to one another. Say you add a vacuole what effect should that have? Should it increase all your thresholds for all compounds? Should you be able to choose a specific compound for it to store?

Normally it really doesn’t matter what your thresholds are because compounds are just passing through the bins as they are processed and storage isn’t really important. However it is very important during a period when a resource is scarce. Maybe there is a day night cycle or maybe there are periodic bacterial blooms which use up all of one compound. In these cases what you are storing, and how much of it you have, becomes very important.

Edit: @seregon will hate this because it’s discontinuous but…

We could have a low vent threshold and a high vent threshold. When the level of the compound gets to the high threshold it instantly vents down to the level of the low threshold. Obviously disgustingly discontinuous but it would work really well with the compound clouds because the microbes would produce a reasonable sized cloud every once in a while rather than trying to produce a little cloud every timestep.

I suppose in the CPA system the release could be spread out over time to get the continuity back whereas in the swimming around it could be instant.

1 Like