CPA Prototype


#41

Sorry can you expand a little on this and what it would look like?


#42

So if an organism only stores a fraction of the biomass it ingests and makes use of (because the rest is used for energy), then its total biomass is necessarily a fraction of how much it eats.Organisms also tend to only ingest and make use of (rather than passing out as waste) a fraction of the biomass of their food. Combine these two fractions (though the first one is a bit more complex, since it’s a maintenance cost and thus depends on organism lifetime), and you get the proportion of biomass that a predator species can sustainably have based on a particular prey species.

Each of these diminishing proportions of biomass, from primary producer to predators thereof and predators of those etc, is a trophic level.

So to get these trophic levels to arise naturally, you need the two factors I listed above, one being making each species have a maintenance cost, the other being what I imagine your predation ratio to be – how much of a stereotypical prey can be eaten, and how much is waste.


#43

Interesting, thanks.

So first I removed all the pygame code so now it will run with just python, in case that’s helpful.

At the moment there is no waste from predation, there is just a limit on how much of the other species you can eat. I guess you are completely right that if there are two species, A and B, then if A produces sugar and B is a predator for A then the only way B can get sugar is via A. I’ve put in a readout of the dry mass of each species, here is a run with that new info.

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 1 A : 3 P : 1 C : 2 Y : 3 L : 2 M : 4 T : 20 O : 20.8874316534 .
F : 0 A : 1 P : 0 C : 6 Y : 4 L : 2 M : 5 T : 20 O : 15.7426095985 .
F : 4 A : 1 P : 1 C : 2 Y : 2 L : 0 M : 1 T : 14 O : 18.2703046618 .
F : 3 A : 2 P : 0 C : 2 Y : 2 L : 1 M : 1 T : 15 O : 19.4726670334 .
F : 1 A : 1 P : 1 C : 2 Y : 1 L : 2 M : 0 T : 13 O : 16.3420614183 .

to

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 4 A : 6 P : 4 C : 1 Y : 3 L : 1 M : 3 T : 25 O : 16.9805498558 .
F : 0 A : 2 P : 2 C : 3 Y : 4 L : 2 M : 5 T : 22 O : 10.8482984005 .
F : 6 A : 3 P : 4 C : 1 Y : 3 L : 0 M : 0 T : 20 O : 11.5718328413 .
F : 4 A : 7 P : 2 C : 3 Y : 3 L : 0 M : 0 T : 22 O : 14.4048840178 .
F : 2 A : 8 P : 6 C : 0 Y : 2 L : 0 M : 0 T : 20 O : 24.8545234382 .

Which maybe isn’t great because the super predator, with 8 Agent glands and 6 Pilli, has the most biomass. However it is feeding off four other species so it’s reasonable it has a high biomass.

The thing with how things are now is that you can happily be a predator and a photosynthesizer at the same time. What do you think we should do about that? I was wondering about making chloroplasts heavy (so you would be slow and unable to catch other species to eat them) but maybe that is too artificial.

I’ve added some spillage from predation (50%), here’s how a long run looks now.

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 1 A : 1 P : 0 C : 1 Y : 1 L : 0 M : 0 T : 9 O : 20.5324943139 .
F : 1 A : 2 P : 2 C : 2 Y : 2 L : 4 M : 2 T : 18 O : 20.575980963 .
F : 1 A : 2 P : 3 C : 2 Y : 5 L : 4 M : 2 T : 22 O : 19.9630312603 .
F : 0 A : 0 P : 1 C : 5 Y : 3 L : 3 M : 1 T : 16 O : 17.0474306477 .
F : 1 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 1 T : 7 O : 18.9451554871 .

to

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 2 A : 1 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 5 O : 25.6727993207 .
F : 0 A : 5 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 7 O : 25.5827277605 .
F : 0 A : 3 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 5 O : 24.1110263641 .
F : 0 A : 2 P : 2 C : 0 Y : 1 L : 1 M : 0 T : 7 O : 21.9374194602 .
F : 2 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 0 T : 5 O : 23.3325653185 .

It’s made all the cells have a much smaller number of total organelles. This is a run with a spillage of 20%.

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 1 A : 0 P : 3 C : 1 Y : 3 L : 1 M : 0 T : 13 O : 20.8742907023 .
F : 1 A : 1 P : 0 C : 0 Y : 1 L : 1 M : 1 T : 7 O : 23.0993894608 .
F : 1 A : 0 P : 1 C : 3 Y : 3 L : 2 M : 1 T : 17 O : 17.3364950503 .
F : 0 A : 0 P : 2 C : 2 Y : 2 L : 2 M : 2 T : 13 O : 19.2264483593 .
F : 3 A : 0 P : 1 C : 3 Y : 1 L : 2 M : 1 T : 15 O : 17.8470476983 .

to

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 1 A : 4 P : 6 C : 1 Y : 2 L : 1 M : 0 T : 19 O : 19.3247056392 .
F : 4 A : 7 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 13 O : 22.885486429 .
F : 0 A : 1 P : 2 C : 0 Y : 1 L : 0 M : 1 T : 6 O : 18.2889523145 .
F : 2 A : 1 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 5 O : 21.5578529868 .
F : 1 A : 6 P : 3 C : 0 Y : 1 L : 0 M : 1 T : 14 O : 21.1203062248 .

Interestingly two of those species might be scavengers. Anyway it’s totally not doing any trophic behaviour properly. :bear:


#44

But do you have any maintenance costs? Or does all food immediately go into growing the population?

Spillage ratios will only change the effectiveness of predation versus scavenging; but maintenance costs will actually reduce the amount of compounds available from a kill (compared to how much the prey ate over its lifetime).


#45

Firstly would you be interested in playing around with the model a bit yourself? I would be nice to get some more runs put through it to see how robust it is etc. I removed all the pygame code so all you need is python 2.x and some time (a 1000 steps between auto-evos + 100 auto evos takes my pc about 20 minutes). Without looking at any of the code you can alter the parameters (which are just below the permeability values), see what you think.

Secondly by maintenance cost do you mean something like “it costs you 5 protein per turn to exist (for repairs etc)” or something like that? If so we’ve never really had that in the model before. If you think it needs to be included then it would be helpful if you could make a broader argument for it.

  1. What behaviour does the model have now that isn’t right? (In what sense not right, not like nature? Because that in itself could be an intrinsic problem of the model not necessarily of implementation)

  2. What behaviour would you like the model to have?

  3. What mechanism are you proposing to add and how do you think that will manifest the new behaviour?


#46

Sure :smiley:

I think it would be best to model it as an ATP cost – so you don’t lose biomass (protein) due to the need to maintain yourself, but you do require constant energy to keep things running.

Sure thing:

  1. In the model, all food a species ingests (ignoring dietary imbalances) will end up driving growth. ATP is only used up to produce compounds needed for growth, so all catabolism (energy production reactions) have their rates driven by growth.

  2. This manifests itself in, for example, the fact that primary producers are able to sustain so many organisms. But the problem runs deeper than that – if you peek in on the predation_relations matrix to see what predates on what, and then compare biomasses, you’ll see that a population can sustain a predator population just about as large as it.

  3. In the real world, since much of what any organism eats and digests and metabolizes will be used solely for energy (exergy, technically) production to fulfill the needs of basic maintenance and other non-growth functions, with the mass expelled as waste, then any population will necessarily have a maximum biomass that is a fraction of the total biomass of all the populations which they prey upon.

  4. This would be fulfilled by having an additional ATP cost for maintaining the population, which scales with the population (probably simplest reasonable way to do it is scale with total dry biomass, using a constant ratio for now).

I would test it but I noticed your reply right as I was getting ready to sleep. What do you think?

Edit: Ok so I tested a simple maintenance cost, where it just halves the amount of available ATP before running the organelle processing for each species each step, and it gives some pretty good preliminary results, with all but one species developing chloroplasts. I’m going to work on making maintenance costs depend on what organelles the species has instead; so flagella, for example, will require more energy.


#47

I rewrote a lot of the code so that the populations are smoothly maintained after a mutation takes place. It pretty much wrecked everything.

F : 1 A : 3 P : 1 C : 0 Y : 1 L : 1 M : 1 T : 10 O : 0.636787236923 .
F : 1 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 1 T : 7 O : 0.621382861268 .
F : 1 A : 2 P : 3 C : 1 Y : 3 L : 1 M : 3 T : 18 O : 0.303018944445 .
F : 2 A : 0 P : 0 C : 3 Y : 1 L : 0 M : 1 T : 8 O : 0.577795965103 .
F : 1 A : 0 P : 1 C : 2 Y : 2 L : 1 M : 1 T : 9 O : 0.505865978447 .

to

F : 1 A : 2 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 5 O : 1.03538623385 .
F : 2 A : 1 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 5 O : 0.989203492543 .
F : 0 A : 1 P : 2 C : 0 Y : 1 L : 0 M : 0 T : 5 O : 1.0118808884 .
F : 3 A : 0 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 5 O : 0.973615786634 .
F : 1 A : 1 P : 1 C : 0 Y : 1 L : 0 M : 0 T : 5 O : 0.986813331802 .

they were all happily living without chloroplasts.

And then I increased the compounds of which a nucleus is made and they all fell down to this

F : 0 A : 0 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 2 O : 0.409132671057 .
F : 0 A : 1 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 3 O : 0.422361570145 .
F : 0 A : 0 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 2 O : 0.409132671057 .
F : 0 A : 3 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 5 O : 0.463383671883 .
F : 0 A : 0 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 2 O : 0.409132671057 .

which sucks.

Yeah something bad is happening. This is such a depressing system to work in, it’s far too complex to be able to control so when it doesn’t do what I want I have no idea what to do. Why isn’t this working? No idea.

Look at this, with predation off,

F : 0 A : 0 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 2 O : 0.000177381447388 .
F : 0 A : 0 P : 0 C : 0 Y : 1 L : 0 M : 1 T : 3 O : 0.000175282182241 .
F : 0 A : 0 P : 2 C : 1 Y : 1 L : 1 M : 3 T : 13 O : 0.000170342658209 .
F : 1 A : 2 P : 0 C : 2 Y : 1 L : 2 M : 1 T : 14 O : 0.000165577747397 .
F : 2 A : 0 P : 0 C : 0 Y : 3 L : 0 M : 1 T : 9 O : 0.000179075050246 .

the populations just collapse, why? No idea. :crying_cat_face:


#48

Ok, having been out for a walk and thought about this for a bit here’s what I think.

  1. I’m going to take a break from working on this for a bit.

  2. We should go back and do the prototype in layers, which are

A. Compound processing only
B. Predation
C. Auto-Evo

We should really robustly test each layer before moving onto the next. For example in A does a patch without chloroplasts die out? It should. Does a scavenger species have a lower dry mass than one which has it’s own chloroplasts? Are the population levels reasonable etc.

The mess I’m in now is that I’m trying to change things in layer A while trying to keep B and C going on top, which is a bad idea.

The first things to decide are “how is population calculated from compounds?” and “how does a large species have a larger throughput of compounds than a small one?”. We haven’t actually ansered these questions so layer A isn’t really working so of course the whole thing is failing.


#49

Unfortunately I don’t have much to be able to contribute, but why not offer this to the interwebs (e.g. reddit, a game developer forum, etc.) and try to get people to play with the numbers and find something that works?


#50

The issue is that we’ve got a core problem (which is a good thing to discover as that’s kind of what prototyping is about).

Basically the amount of sugar that your species should produce, as a whole, should scale with the number of chloroplasts your species has in total. So that means if you have 1 per member and 1,000,000 members you should be able to produce the same amount as if you have 2 per member and 500,000 members.

However the challenge with this is that auto-evo will tend to choose to always get rid of an organelles. Because making your species smaller means it’s made of less compounds per member and that means you can have more members which means you get more organelles kind of for free. We need to sort this out and it’s not going to work until we do.

Where it was working nicely above the rate of compound processing wasn’t related to population and so a species with 1,000 members would make sugar the same speed as one with 1 member even if they are identical, which is obviously not what we want.


#51

We might be able to fix this, at least partially, by having a maintenance cost consisting of both a flat term and a term that scales with cell size faster than linearly.

IRL there’s quite probably an efficiency optimum around the size of the average protozoan; but that isn’t reflected in auto-evo right now obviously. If we just add a flat maintenance cost, we can force a minimum viable cell size, and by adding a scaling maintenance term we can avoid any runaway cell inflation that would end up being forced to happen by a flat, per-cell cost.

The flat cost can be rationalized as the minimum cost of maintaining a minimal cell, and the scaling cost can be rationalized as the cost of maintaining each additional organelle along with the increasing cost of plasma membrane transport (due to declining surface-area to volume ratio, requiring more energy to pump in/out enough compounds to maintain the cell) and the increasing cost of reproduction, etc. But we don’t have to worry about modeling the various reasons for the flat and scaling costs; certainly not for now anyway.


#52

I have an idea for solving the discontinuities – in the projected simulation, we could interpolate all species values from the original state to the new state.

You’d have the fitness values, compound composition, etc, for the mutant, and you’d just average them with the corresponding values for the original species, interpolating from having a population weighted entirely towards the original, to having a population weighted entirely to the mutant.

This is simpler than having the mutant be a separate population which competes with the population of non-mutants; because if we assume that the mutation will eventually dominate the population, then we already know that the endpoint is a population of mutants, so all we have to do is smoothly transition towards it, and have a bunch of simulation steps after the transition so everything settles down. And of course, the reason we can assume that the mutation would dominate, is because the entire point of auto-evo’s projected simulations is so we can find a mutation which will dominate.


#53

Yeah I’ve been thinking something similar, I like what you’re saying.

Re having a constant + polynomial cost function my concern is that is too heavy handed. Like we want microbes which are like grass, right, which have just chloroplasts and plant cell walls and are able to breed like crazy fast. And we also want the big complicated predators which have loads of organelles and win every fight.

I was thinking that maybe we should think more deeply about what we are trying to model (in the hopes the results will fit nature more closely). Like why do you need mitochondria? Because you want to be able to produce a lot of energy. So maybe I should turn the energy cost of flagella up a lot so that you need to have mitochondria in order to power them (maybe we should have other cells which cost energy, like bioluminescant or water pumps).

Same with lysosomes, why do you want to break down protein (rather than just immediately use it for growth?). Maybe it’s worth having like “self protein” and “other protein” and you can’t turn “other protein” or “other DNA” into more cells of yours you have to break it down and built it up again. That would make lysosomes useful, as you suggested a while ago. Right now protein is much more valuable to you than it’s components so it’s never worth breaking it down.


#54

I think both of those are good ideas – and each would have it’s own ATP costs, which would make for a more natural way to scale maintenance costs with the size and composition and behaviour of an organism. I was only suggesting a very simple maintenance cost function so we can test the basic result (of changing what size they’ll optimize towards).


#55

I think that’s a good idea.

I think we’ll have to choose how much control we want over the system, do we want to force it to look how we think it should look or are we happy if it often comes out wildly different?


#56

That’s a bit of an ill-defined question :stuck_out_tongue:

There are some behaviours/properties that we want the system to always display (for example, trophic levels and energy pyramids) even if we don’t code them in explicitly; but there are a lot of other things where we want the system to be more innovative. I don’t think I can give a more specific answer without enumerating all possible behaviours we might like the system to have.


#57

Hi hello I was talking with some guys in the Thrive skype group and this might be a bit late to mention this but would it make sense to allow the player to go extinct at this stage? In the real world isn’t it borderline impossible for microbes to go extinct as they reproduce way too fast and the populations are up in the billions?


#58

We have a skype group?

And yes, I think it’s been part of the plan (for longer than I can exactly pinpoint) to allow the player’s species to go extinct.

While a species might have a huge population, there’s always the chance that it would simply be outcompeted in all patches, and thus drop in population, and quite possibly go entirely extinct. Or, indeed, it can be a victim of circumstance, much like how the rich world of anaerobic prokaryotes faced massive losses thanks to the rise of cyanobacteria and the oxygenation of the oceans and atmosphere.


#59

So I’ve been playing around with this a bit (I went and looked at all the processes running and found they had gone haywire, I think the step length was too short) and this is quite hopeful. In a patch with no predation and no scavenging (you have to make everything from scratch) the following result is nice. It trialed removing the last chloroplast and the population crashed, which is very hopeful that it’s working better.

Mutation will be applied to species 2
Patch 0 will be the control.
In patch 1 removing Agent Gland
In patch 2 adding Mitochondria
In patch 3 adding Flagella
In patch 4 removing Chloroplast
Percentage Completed : 0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 done
The resulting populations are :
0 : 28.1572134292 1 : 29.4552372482 2 : 28.0231015215 3 : 27.4647290579 4 : 14.8121745563 .
The best version was in patch 1 with average population 29.4552372482
Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 1 A : 1 P : 3 C : 3 Y : 2 L : 1 M : 4 T : 20 O : 7.95552900387 .
F : 0 A : 0 P : 0 C : 2 Y : 2 L : 0 M : 2 T : 15 O : 9.85783058708 .
F : 2 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 7 O : 29.4552372482 .
F : 1 A : 0 P : 2 C : 1 Y : 1 L : 0 M : 3 T : 9 O : 27.7953742456 .
F : 0 A : 0 P : 0 C : 2 Y : 1 L : 0 M : 2 T : 9 O : 41.918679826 .

However they may well all be heading for organelle counts of 2, not sure. After running for a long time it ended up with this

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 0 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 5 O : 32.927965766 .
F : 0 A : 0 P : 0 C : 1 Y : 4 L : 0 M : 0 T : 9 O : 81.2634684396 .
F : 0 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 5 O : 34.4976761388 .
F : 0 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 5 O : 34.0063172659 .
F : 0 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 7 O : 61.9414309715 .

Which I guess is ok for a non-predation patch. It’s weird the one with 4 cytoplasm does so much better.


#60

This is quite interesting. So I’ve been running the system with ocean mixing set to 1 (which means that anything the microbes put into the patch gets instantly washed away, the water in the patch is the same as that in the ocean as a whole). The reason for this is there was a protein cycle before, so species A would make protein and then, when it died, that protein would go into the patch and another species could absorb it and immediately put it into their locked bin (make new members out of it). This meant it was a bit easy to be a scavenger.

Anyway here’s a result after 108 auto-evos (which isn’t very many, each species only gets like 21 changes on average).

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 0 A : 4 P : 2 C : 0 Y : 1 L : 0 M : 0 T : 8 O : 4.46654783014e-58 .
F : 0 A : 3 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 5 O : 1.23767072247e-11 .
F : 1 A : 4 P : 2 C : 3 Y : 3 L : 2 M : 3 T : 19 O : 1.52591081771e-13 .
F : 1 A : 1 P : 1 C : 3 Y : 2 L : 0 M : 0 T : 9 O : 1.17022791251e-13 .
F : 0 A : 0 P : 0 C : 3 Y : 1 L : 0 M : 1 T : 7 O : 72.6981404907 .

The top species has 10^59 times more biomass than the bottom one! Crazy. The top one is a pure photosynthesizer (3 chloroplasts no weapons) and the bottom one is a pure predator (4 agents + 2 pilli and no chloroplasts) so that does fit with the idea of trophic levels. (But is probably a fluke :smirk_cat:)