Playing with populations



For once, there are no bugs to report, or fix. There are some utility methods I should add, and the perennial chore of updating the documentation. All that is all well and good, and I’ll get it done well… or good. However, since I can, I spent a few days just playing with the system and some of the populations that have been generated.

Let me introduce you to some of the populations.

“Populations of what?”

Good question. By “populations,” I mean several little digital organisms that have emerged from randomness. Each individual, or “figure,” is a small program that lives and runs inside a world written for them called the “realm.” The figures do their best to survive. The chief method of survival is to copy one’s self. That’s fairly simple, but even just that simple imperative had to emerge, rather than be coded in, and it turns out there is more than one strategy of self-replication a population can adopt.

Take “s.pop,” or just s. S is a population of two figures. He developed in a realm that had only three slots, and allowed a maximum population size of just two. One day, I moved s to a larger world to see how he’d handle the change. Some small populations, once freed into a larger world, immediately died. S managed to survive, but rather than expanding to fill the available space, s stays at two figures, and always and forever just two figures, no matter how much room there is.

Next, meet “6.pop,” or just 6. 6 grew up in a realm that had 30 slots, and a maximum population size of only 20 figures. 6 was originally named m0. M0 had 17 figures, and whenever I ran m0, the population would drop down to six figures. Once at that size, they stayed at 6, and always and forever 6, no matter how much room there was to expand.

Keep in mind, for both s and 6, they are still making new copies of themselves, new children are still being born. However, each time a new figure is born, one of the old ones dies, so the population stays at two for s and six for 6. For s, it was an adaptation, a self-imposed limit on population growth that helped to keep him stable. Keeping the population at 2 and always and forever just 2 kept s from being wiped out completely. In biology, when one cell dies for the sake of the overall organism’s health and survival, it’s called “programmed cell death.” That’s what s is doing. So is 6, though the next population shows that programmed cell death isn’t necessary in the 30 slot 20 maximum pop size realm 6 came from.

Now, the flashiest of them all, “m1.pop,” or just m1 for short. Like 6, m1 grew up in a small realm with 30 slots, and a maximum population size of 20. M1 has twenty figures in her population, but unlike s or 6, when given more room to expand, she will. I ran it up to the point where my system crashed, and m1 never stopped expanding to fill all available space, and never became unstable after all available space was filled.

Last of all is “u.pop,” AKA. u. U emerge from a realm with 300 slots and a maximum population size of 200. He’s our poor country cousin. He runs slower than any of the others, taking many more commands to manage to create a child figure. What’s more, u can only make 889,596 children before something changes, and all the figures in u die.

There’s a difference between the population size, and the number of child figures that get written or born. S can and has made billions of children, but there are only two figures alive at any given moment. By contrast, u has 200 figures alive, but can only make 889,596 child figures before all the figures die out. Meanwhile, our feisty little m1 can make billions of children, but unlike s or 6, she always expands to reach the maximum population size allowed; unless you try for 2,000,000 and the system crashes.

Now that you and the populations have met, let’s mess with them.

In most artificial life systems, the population never reaches 0. Once the population has less than some minimum population size, some new, usually randomly constructed, creatures are created. I’ve been allowing the population to reach 0. Once all the figures have died, some number of randomly generated figures is added, and that population is allowed to live or die, according to its nature. My approach has worked, but I wondered what would happen if I added some randomly generated figures into the mix with some of the populations that have emerged. What if I ran it more like everyone else?

I started with s. I put in 10 randomly generated figures with the two figures of his. The result? He died. I ran it several times, and always got the same result.

When I tried it with m1, I added 100 randomly generated figures to see how she’d handle it. She won! Every time I ran the experiment, m1 would quickly take over the population, and then expand to as large as she could get, and then just keep making babies on into the night!

The interesting one was 6. I started with her m0 incarnation. When I added 10 randomly generated figures to the 17 of m0, she died. Then, I ran m0 all by herself, until she’d slimmed down to only 6 figures. I saved those six figures and tried adding randomly generated ones in with her. If I added only ten random figures, 6 did fine. She’d end up with some number of figures above the minimum population size, and below the maximum population size. Then she’d stay there. For example, in one run, the minimum population size was 10, and the maximum was 20. She reached 13 figures alive, and then there were 13 figures, always and forever. If I added 100 randomly generated figures, using a minimum population size of 100 and a maximum population size of 200, sometimes she’d make it, and sometimes she wouldn’t. again, if she did manage to stabilize, she’d find some number of figures between the minimum and maximum and stay there.

M1 and 6 have different strategies. One searches for a stable population size, while the other just fills up the world. I decided to take a closer look at them.

It turns out, of the six figures in 6, three of them are viable and three of them are not. That’s to do with the way they are saved, which freezes a population in the middle of whatever they’re doing. This means that you can have figures that aren’t fully written yet. Each one of the three figures that happened to be in a viable state acted the same. If I put them in a realm by themselves, they’d make one baby figure, then those two would continue to make babies, while the population stayed at two, and only two, and always and forever two. It’s the same thing as s, only since there are three of them, you end up with a population size of six.

M1 was a little different. She has 20 figures to dig through. I managed to find out that if I deleted all but eight of them, she’d still run as usual. If I deleted one more, she died. Since I was left with eight figures, I deleted 12 and saved those eight in a file, creatively named “8.pop.” Then I deleted the last 7 from the other end, and was left with only one figure. That figure, if run by its self, makes a clone of m1. Just 1 figure can reach an arbitrarily large population size, and remain stable. I saved that one prolific figure in “8.pop.”

Meanwhile, what about u?

Now that I have several populations to experiment with, it’s time to try out a little mutation. For 6 and m1, most mutations are likely to cause problems. It will be interesting to see how stable they are when they start randomly changing. U, on the other hand has a fatal sickness. He cannot make more then a certain number of children before all his figures die out. Mutation is u’s only hope. Obviously, somewhere in the program of u’s figures, something is wrong. It will be interesting to see if mutating u can make him stable.


Leave a Reply