@swamidass You misunderstand - I did not create a simulation of evolution - I used a genetic algorithm to find a type of optimum solution in a complex setting having nothing to do with biology. Solution evolve, but this was a "for fun:exercise in learning about genetic algorithms.
Having come this far, I’ll describe it a bit. You can decide if this warrants discussion. I can’t present the code here (ask me privately).
The setting is a game, written by a friend of mine who occasionally consults me on mathematical/statistical questions. In this game players can design their own ships and use them in the game. Without going into details, the ship design process is very complex, spreadsheet assisted, and deliberately made difficult for players to create a single game-winning design. For anyone reading this who might be familiar with the game Star Fleet Battles, this game is not entirely different, but it tries to capture any Sci-Fi setting rather than a single one.
This is getting long and I have a busy day, so short version … I wrote code to implement the combat damage allocation in this game, simulated survival time for ships given a baseline “attack”, looked at the resulting survival distributions, and calculated an approximate distribution to how much total combat damage each ship to do in “return fire”. This is a sort of utility function, and turns out to be a good measure of effectiveness in the actual game. It is related to a mathematical relationship used in real military simulations (Lanchester’s Laws). That’s the fitness function, and the most difficult part of the coding.
Ship design requires a string of roughly 60-100 numbers and MANY choices on the part of the player. The “genetic” part of my program did not implement the whole design process, but only the ways players could rearrange a set of “parts” within a fixed design, some of which lead to greater survival than others.
I coded random variation into the arrangement process, and later added a second step for a sort of sexual mixing: child ships could receive complete sections from either parent. The way I did this does NOT match how sexual mixing and mutation actually work (that was not my intent).
The end result: The GA found arrangements to preserve key functions of the ship designs, optimizing their utility for the game. What human’s perceived to be optimal arrangements weren’t always so, and the point-value system within the games was changed to more closely reflect actual with-game utility (fitness), and a better way to set up “fair” scenarios. In the process I observed GA in action, which was interesting and fun (which was my intent). I can’t quickly described all the different ways I looked into this data, so I won’t try.
This is intentionally a “toy” I created a toy to learn about GA’s, but I see no barriers to applying this simple optimization method to much larger more complex problems and fitness functions. The GA itself is almost trivially easy to code, it’s the fitness function that is difficult.
Doing this in the setting of a game gave me a completely known function, so all I have to do was figure out how to code it. Coding a “real” biological fitness function is a non-trivial problem.