I have upgraded the program - it is now a windows program.
The program tests various evolution scenarios. Nothing evolves except strings of pseudo-genes, represented by numbers. The number of genes per "creature" is specified at 10. Initially, for example, a 10 gene creature may become 5555555555. But you can set the starting values anywhere from 2 to 8. The best possible creature is 9999999999. Worst possible creatures would be all zeroes. In the latest version, it is possible for a creature to retain a gene of value zero, unless the creature happens to be tested.
You specify for a given run how many mutations you add to your population of creatures. You specify the odds for a mutation to be good versus bad. Then you run as many generations as you choose and you salt the genes with mutations as you choose and watch what happens.
Provisions are made for viewing the individual gene strings and also for viewing a helpful summary of the genes at any one time. If you set a smaller population, say under 500, it might be reasonable to view every gene. If you are running a simulation of 50,000 creatures you'll probably only sample the popultations. There are many genetic simulation programs but in most of them you can't tell by looking if a given gene is good or bad. In this program, we can tell the relative value of every gene at a glance!
When you choose to run a single generation, here is what happens: If you have automatic mutations turned on, first thing is to have those mutations happen. When the machine implements mutations, good or bad - for each number of mutations you specified, the machine will randomly pick a single gene from the whole population. If the machine is implementing a bad mutation, it will decrement the number by one. 5 becomes 4, 4 becomes 3, unless the gene is already zero, in which case no change is made, but that still counts in the genetic mutation count. For implementing a good mutation, of course, the gene is booted upwards by one, until it reaches 9, and then it can't be booted any higher. Mutations are made in the amounts you set up either as a special command by you OR, in the automatic mutation mode, with every generation.
Next, reproduction occurs. A whole set equal in number to the present population of creatures is prepared. They are prepared by randomly copying from one of the existing creatures. If you are running the simulation with the genetic exchange option (sex) enabled, the gene string is created by a random mix from two existing creatures; the first part of one added to the second part of the other. The point where they are joined is also selected randomly each time - its not always exactly in the middle!
But as part of the simulation, you specified how many "creatures" can be viable in the given simulation, and suddenly, we've got two times the allowable number! Well, we reduce the numbers by exposing them to the "trials of life".
Over and over we pick a random gene string. We add up all the genes in that string. We also add up the maximum possible score if the genes were all nines. We add a couple extra to that optimal score. We make a fraction out of the two numbers. This fraction will always be less than one, hopefully not as low as zero. We compare that fraction to a number randomly generated by the computer between zero and one. If the computer generated number is bigger than the fraction, the gene string dies - it is erased. Otherwise, it is left along. Also, if the gene string has a zero in it, that creature dies regardless. The only way a gene string with a zero it it can survive is if that gene string doesn't get tested. This can happen by chance or when so many bad mutations are added in a generation that even zeroes begin to accumulate.
We keep doing that until the number of surviving strings is back to the original size. Think of a colony of bacteria competing for a limited food supply, or a fish tank of guppies that eat up all the extra babies.
You see how we hope to see some Darwinian Evolution here. The higher numbers obviously will give a gene string some advantage, on the average, but it is also not a sure fire thing - there's a random component involved here! Does Darwinian Evolution actually work? Can we get all nines under reasonable conditions?
You can choose to run for a finite number of generations and then automatically halt or you can choose to run indefinately. In either case, you can choose to have mutations automatically occur every generation or not. You can also choose to impose mutations on on the existing population without running a generation. The indefinate run mode will continue evolving the little guys until either a single string of all 9's is detected or a single string of all 0's is detected, at which point the evolution is halted and you are informed how many generations it took to get there.
If your parameters allow for evolution to succeed in generating all nines, the simulation will start slowing down between generations as the strings get closer and closer to all nines. That's because it takes more and more "trials of life" to kill off those hardy little higher numbered genes. Try starting with 10 genes per creature, 1000 creatures, 25 bad mutations, and 2 good ones per saltation. What is the difference between evolution with or without sex? How many generations does it require to get to all nines?
One estimate is that in real life, bad mutations outnumber good mutations a thousand to one. What happens if you set your machine to have 50,000 creatures, and good mutation odds at only .001, with a thousand mutations per generation - can the creatures survive the genetic load of those bad mutations? If they can survive 1000 bad mutations per generation, how many bad mutations per generation will it take so that they DON'T survive?
Note that due to the random element involved, the same paramaters will not always achieve success (all 9's) in the same number of generations each time you try them. But there are trends and averages to be determined.
Drop me a line if you have any questions or comments. I'm Paul Richmond, reach me by emailing me here.