Member # 3773
posted April 16, 2005 21:37
$elation = (hahahahahahahahahahahahahahahahahahaha) x 1000;
ladies and gentlemen, it works. The program I wrote to simulate genetic drift/selective breeding for an advanced science at class at school *finally* runs. fast, too!!! I wrote it in C++ (ugh), just because it made the code easier to read/organize.
so, a list of implemented features:
arbitrary population size (limited by available memory)
up to seven significant traits to analyze
one set of breeding rules
up to eight sets of kill rules
arbitrary minimum reproductive age
You guys probably don't realize what a significant triumph this is for me. The design is beautiful (at least I think so), with each organism taking only four bytes of memory, meaning that you can have populations of hundreds of millions in a simulation. Almost all of the code executes in user space, with the only system calls being statistics and progress output at the end of each iteration.
The code needs to be cleaned up a bit, once that's done I'll post it on my website so people can download it and laugh at me. All told, it's about six or seven pages of code. The reason it took me so long to write is that I kept the C coding mentallity, which means that I'd write functions that would work in C and they would totally just not work with C++... I tell ya, object-orientation is a fickle friend.
wow, I don't even know why I wrote this... just thought I should share with the world.
"The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital computer or the gears of a cycle transmission as he does at the top of a mountain or in the petals of a flower." - Robert M. Pirsig
Posts: 948 | Registered: Mar 2005
| IP: Logged