ramblings and opinions of a geek

LifeEngine is a little simulation written in Python that, at its most basic core, simulates lives. Not like the Sims. The plan is for it to be a customizable simulation that simulates life, reproduction, death, evolution, etc. The customizability will come from the feature of being able to define attributes and conditions for certain things.

For example, currently, there is the Life class. A Life has two attributes: gender and age. The class has a compatible(self,life2) function that determines if that Life is compatible (ie. can mate) with another.

Currently there is a half-coded LifeEngine class that will handle the actual running, but I did write up some functions that try to mate two Lifes. The function checks if lifeA is compatible with lifeB, and if lifeB is compatible with lifeA.

As would be in most real-world scenarios (even with simple animals), both mates have to be compatible, and the compatibility is determined for another mate is determined by the Life itself. In this case, Life’s compatiblity function just tests if the other is not of the same gender as well as the age difference.

The “mate” function then tries to spawn a new Life. At this point, the two Lifes have “mated”. An offspring is produced based on a certain “complex” algorithm (dice roll).

Currently, the methods are pretty lame. There is no death, no actions except reproducing (and nothing to make that happen except a loop!). But the excitement lies in the customizability. Once the framework is done, one can simple code a Life that specifies some functions.

Two top-level functions (ones that are called directly from the engine) are currently planned for the default implementation. I’m not sure of the exact function or implementation yet, but they will handle reproducing and death.

These functions can be as simple as mention above, or as comlex with social factors etc. The Game of Life can easily be implemented with this function. And there’s nothing to say that the engine itself won’t be extendable. I’m pretty excited about it. Please feel free to email me or post a comment if you’ve got some ideas, opinions, or whatnot.