# CPA Algorithm

#21

Yeah I’m not sure either. It could be full random, as in a random number of areas and a random distribution of compounds. Would be interesting but meaningless. It could be driven by a climate model but it’s hard to get that level of resolution.

The problem with a purely associative system (fruit trees are near water but we don’t know where either is) is non-uniqueness, as above with the three colour diagram you drew.

@moopli have you got any thoughts? Would you be ok with “areas” or would you prefer a more abstract, associative approach or something completely different?

#22

The other concern with an arbitrary number of areas is that the ‘time spent in each area’ vector above becomes evolvable, so that number of areas has to be constant across all patches… making it even more arbitrary.

I don’t think we need to link the model to actual areas within the patch (otherwise we’re talking about sub-patches, and just increasing the resolution), they’re just examples of the types of environment found in the patch, micro-biomes/niches.

I’m also not convinced non-uniqueness is a problem, but I need to work through a few more examples to know for sure.

EDIT:
To draw the two systems closer together, what I’m imagining probably would work with the same math as above, but a square matrix, where each area is defined as the distribution of each of the EV’s, with the columns giving the correlation with other EV’s - the degree to which they will be found by spending time in the area containing the row EV. ‘Area’ here isn’t a defined spatial place, but a warped representation of the whole space, weighted according to the concentration of the row EV. Does that make any sense?

#23

I’d suggest trying to show an example, it’ll probably help with thinking it through.

#24

Good idea, but it’ll take some time. I’ll have a go at that tomorrow evening, in the mean time, any other thoughts?

#25

Not really. I think this is adding a lot of complexity and I do see how it could make things more interesting (providing surprising niches like the watering hole, for example). However I think the CPA will work fine without it so if you can find a nice way of making it work then lets go for it, otherwise I think it’ll be ok.

It’ll be interesting to work out the predation equations, that’s the last piece, after this, I think.

#26

I agree with that much, we certainly don’t need this to work to get most of CPA in place, and this shouldn’t necessarily hold us up in getting the rest of the implementation nailed down. That said, I do think this fills a gap that’s lacking in the existing concept, and improve the relation between gameplay and model enough to be worth the effort, we can worry about exact implementation details of this much later (as you say, its a lot of complexity), but I’d like to keep working on the concept a little to see what might be involved, and whether it’ll play nice with the existing CPA concept.

A worked example will go a long way toward that. The other conversations we need to have then are the predation (or rather, all the population dynamics) equations, and the actual implementation - what data do we need, what systems, etc.

#27

I’ve been thinking a bit about trying to have a model built purely on association. So you know only that fruit appears near water a lot but you don’t know where the fruit and water are specifically and there are some questions I cannot answer. How do the calculations work?

Say fruit and water are 100% correlated, then surely prioritising either has the same result? So there is a non-uniqueness problem with the strategies.

When it comes to predation if fruit and water are 50% correlated then somehow the game needs to know that a species that prioritises water has 50% overlap with one that prioritises fruit. So unlike the system above of sub areas you can’t just compare the “time spent” vectors, the correlations come into play.

Also how do the correlations get updated over time? So I spend 100% of my time near the water and I make fruit (I guess I’m a fruit tree) then does that increase the level of correlation between fruit and water? How is this measured?

If you want this to be the system I need an example because I can’t conceptualise it I’m afraid. No rush.

#28

In terms of updating, assuming an ‘association parameter’ would go from +1 for perfect congruence to 0 for independence to -1 for perfect anti-congruence: the association parameter would be an evolved trait, and I think we might get okay results even if the parameter is a ‘fundamental’ one (ie, not derived from other parameters, but directly tweaked by evolution).

Mathematically, we’d have a symmetric matrix that holds the association parameter of every pair of distributions (technically I could say triangular matrix but then I have to worry about indices in my equations), and this matrix would have the elements of a specific row and corresponding column updated together to modify the distribution of a particular species.

Say our starting matrix is A, and we will produce matrix B by tweaking species i’s distribution to make B_ij = c. Then, for every k != i,j, B_ik = A_ik * A_jk * c / A_ij (if I have the various terms ordered right, which I think I do…).

Given the physical environment of a patch, various non-biological data points would have certain correlations, and the rest could be managed by this sort of step-by-step redistribution.

#29

@Moopli could you possibly show an example? Like how above I had a matrix for the distributions of the compounds and a vector for where you spent you time. Could you make a similar example for this associative model? I can’t really conceptualise how it would work.