For a long time, I’ve wanted to create something that is generally referred to as a “neural network”. The concept behind neural networks is the desire to “simulate” the decision-making that our minds are capable of and computers aren’t, namely “generalizing”.
A computer is very good at calculating insane algorithms or at following precise orders given to it from a program, but it’s incapable of the generalizing that we do everyday, for example when we see a human being that we’ve never seen before, and still acknowledge the fact that we are looking at a human being (or a ball, or a dog, or whatever). Neural networks are one of the solutions to this kind of generalizing.
In any case, since childhood, I’ve occasionally been hit with bolts of ambition to reproduce such a neural network, coming up with my own little ideas for how they could possibly work, and failing every single time. Well, I tried it again recently and pulled it off, and was in for a few neat surprises on the way…
Before I continue, though, the math for these things is sadly beyond my level of comprehension; I’ve had to stare myself blind at others’ code, guessing what some math professors might mean when they say [insert insane algorithms here], and so on — chances are my implementation is off the rocker by several miles, but it’s doing what I wanted it to, and that’s sufficient for now.
The implementation was basically a mishmash of “evolution-simulation” and “neural network”. A number of critters were added to an environment, and were given the alternatives “eat, drink, reproduce, or do nothing” every “cycle”. A number of factors decided when a specific decision was a) possible and b) a very good or very bad decision. If the decision was very bad, the “mind” of the critter in question was modified slightly to not think so highly of that particular action in those kinds of situations in the future. When a critter reproduced, there was a 5% chance the child mutated, i.e. random modifications made to its mind. This became a rather important aspect as it turned out later on. A critter could only reproduce once every 20 cycles, and if it tried earlier, the counter was reset to 0 (i.e. it’s a very bad idea to try when you can’t).
Once the critters ate and drank and, uh, reproduced efficiently enough, the population in the world literally exploded. After about a hundred cycles, they quadrupled in quantity, and kept going infinitely (or rather, until my memory ran out). Every time this happened, I made things trickier for them and reran the test, and without exception, they managed to (eventually) find a way to overpopulate themselves.
One of my first surprises was the fact that they realized that NOT EATING was a great idea. And it turns out they were right. All actions use up 2 cycles (if you do something, you have to idle the next cycle), and if they only drank they would, most of the time, survive long enough to reproduce before they starved to death. And by reproducing so much earlier than the other critters, they literally took over the world. (The reason they had to drink was because thirst increases at a higher pace than hunger, in conformity with how it works in the real.)
In order to cope with the ever present overpopulation problem, I introduced another factor — food availability. Food availability was per-race, and decreased as the population of the particular race increased. An overpopulated race had a much lower chance of finding food than a regular one, so what would happen was that, initially, a few dominant races would appear, grow to overpopulation, and then a number of them would die of starvation and they’d “fall down” to good levels again and go on their merry ways. So I figured that wasn’t very interesting, and decided to add the “turn-predator” syndrome.
The turn-predator syndrome basically comprises of this: an overpopulated herbivore-race has a small chance of “mutating”; if it does, 30% of its population branch off into a new, predating race. This can only happen if there are 0 predators in the world (when I initially let it happen at any time, predators eventually took over the world; then died out because they didn’t have any grassophiles to gnaw on).
Let me tell ya… when I did that, I wondered if I’d done something wrong somewhere. There was this perpetual, evil circle thing going on. The grassophiles would start off on their own, grow to a certain size, then one of them would branch into a new predator race, and then gobblegobble… they’d all die out in a few hundred cycles. Doesn’t matter how many of them there were, they’d simply vanish from the face of the planet. Whenever there was a wipe, the system would recreate ~300 random grassophile races and let them go until the same thing happened. Over and over and over again. Sometimes in a matter of 50 cycles, sometimes in a matter of 5000 cycles, but it kept on happening.
And then it struck me that the critters have an in-born desire to reproduce, but they did not have a desire to NOT reproduce, when reproducing was a bad idea (when the race in question is overpopulated). So I put that in, and boom!
Well, “boom!” is an exaggeration. The evil circles were gone anyway. After a few civilizations, they “got it”, and they got it in a very distinct way.
The ratio herbivore/predator was stubbornly stuck at ~5.5. That is, 5-6 herbivores in the world, for every predator. I also observed a precise pattern in how the world population increased…
Basically, there is an abysmal difference between the population that “is lucky but doesn’t get it (yet)” and the population that “gets it”. The former flutters up and down in wild, irregular manners, and either crashes (wipes) or gets a grip and gets it. The “gets it” population stays mostly still; it increases and decreases slightly, and occasionally it takes little jumps, upward. If plotted on a graph, it would look sort of like a stock report for a company that’s doing pretty well with both ups and downs, but an overall, green little line that kept going ever upward.
Something else I noted was when populations seemed to get it, but, somewhere, either due to bad luck or for some other reason, crashed. I kept thinking that the “system” was so incredibly fragile, but at the same time so surprisingly robust. Just like how biology classes teach you how eco systems function.
There’s a lot more, but to be honest, I somehow doubt anyone will read all this, so I’ll put an end here. I’m incredibly excited about seeing where this is headed, though, that’s for sure. The last couple of days, I’ve been able to focus on nothing else!
Categories