I'm going to use my most recent (as of Feb 2017) evolution simulator,Expression Evolution as a demo/example.
Step Zero
Understand the terminology!
Creature - A single thing that is being tested, and has certain aspects that define it.
Aspects - Characteristics that define each creature, and each creature is judged by some combination of it's aspects.
Fitness - A measure of how well each creature performed due to its aspects.
Mutate - A change in one or more of the creature's aspects.
Generation - One cycle, from determining fitness down to Reproduction and Mutation.
Step One
This is, for me, the hardest step. You need an idea and a way of carrying it out. In Expression Evolution, this was a pain, as I had to use a way that did not seem efficient (Which I am still not convinced it is).
Step Two
Get programming! You will need to generate a lot of random creatures at the beginning. In Expression Evolution, I used the following code (TI-Basic)
Code:
Where the variable 'U' is the number of creatures, and lists A-G contain aspects for each creature.
Step Three
With everything initialized, now it is time to find each creature's fitness. To do this, use a for( loop to go through each creature and determine its fitness (I know, so helpful).
"Well, how do I determine each creature's fitness?" I hear you begging. (Prepare for another helpful sentence) It's up to you. It depends on what you want, as this is the main part that makes each evolution simulator unique.
Step Four
Kill the underachievers! In this step, you kill off the creatures that do not display the traits you want, which is measured by fitness. You can change whether you want to kill the creatures below the median or above the median. It really doesn't matter, as it is your simulator. Also, if a creature survives record its position in a separate list.
Step Five
Using the list of surviving creatures, it is time to create new ones, but with slight mutations. To do this, you need the aspects of a creature that survived. You then tweak these aspects randomly, but only by a small amount. Optionally, you could add less common "Large Mutations" that drastically change some aspect of the creature. After you tweak the aspects, store them into a creature that got killed's aspect.
Recap
Step One: Get inspired.
Step Two: Randomly create 'X' creatures.
Step Three: Determine fitness of these creatures
Step Four: Kill the lower (or upper) half
Step Five: Reproduce and Mutate.
Step Six
If you have done everything up to this point correctly, you will have a program that will run one generation, then stop. To fix this, you need to repeat steps 1-6 for as many generations that you want. Everything from here on out is optional!
Step Seven
Currently, there is no way to see your creature's progress, so why not add a plot that shows the median creature's fitness, and the best creature's fitness.
Step Eight
Share it! I am really interested in seeing what you guys can create. If you need any help, or if you
think I missed something, please do not hesitate to ask!
Step Zero
Understand the terminology!
Creature - A single thing that is being tested, and has certain aspects that define it.
Aspects - Characteristics that define each creature, and each creature is judged by some combination of it's aspects.
Fitness - A measure of how well each creature performed due to its aspects.
Mutate - A change in one or more of the creature's aspects.
Generation - One cycle, from determining fitness down to Reproduction and Mutation.
Step One
This is, for me, the hardest step. You need an idea and a way of carrying it out. In Expression Evolution, this was a pain, as I had to use a way that did not seem efficient (Which I am still not convinced it is).
Step Two
Get programming! You will need to generate a lot of random creatures at the beginning. In Expression Evolution, I used the following code (TI-Basic)
Code:
randInt(1,50,U→⌊A
randInt(1,50,U→⌊C
randInt(1,150,U→⌊E
randInt(1,150,U→⌊G
randInt(0,6→⌊B
randInt(0,6→⌊D
randInt(0,6→⌊F
Where the variable 'U' is the number of creatures, and lists A-G contain aspects for each creature.
Step Three
With everything initialized, now it is time to find each creature's fitness. To do this, use a for( loop to go through each creature and determine its fitness (I know, so helpful).
"Well, how do I determine each creature's fitness?" I hear you begging. (Prepare for another helpful sentence) It's up to you. It depends on what you want, as this is the main part that makes each evolution simulator unique.
Step Four
Kill the underachievers! In this step, you kill off the creatures that do not display the traits you want, which is measured by fitness. You can change whether you want to kill the creatures below the median or above the median. It really doesn't matter, as it is your simulator. Also, if a creature survives record its position in a separate list.
Step Five
Using the list of surviving creatures, it is time to create new ones, but with slight mutations. To do this, you need the aspects of a creature that survived. You then tweak these aspects randomly, but only by a small amount. Optionally, you could add less common "Large Mutations" that drastically change some aspect of the creature. After you tweak the aspects, store them into a creature that got killed's aspect.
Recap
Step One: Get inspired.
Step Two: Randomly create 'X' creatures.
Step Three: Determine fitness of these creatures
Step Four: Kill the lower (or upper) half
Step Five: Reproduce and Mutate.
Step Six
If you have done everything up to this point correctly, you will have a program that will run one generation, then stop. To fix this, you need to repeat steps 1-6 for as many generations that you want. Everything from here on out is optional!
Step Seven
Currently, there is no way to see your creature's progress, so why not add a plot that shows the median creature's fitness, and the best creature's fitness.
Step Eight
Share it! I am really interested in seeing what you guys can create. If you need any help, or if you
think I missed something, please do not hesitate to ask!