WillWybrow.com

Internet Tsar

Evolutionary Model

Posted in Chronicles by Will Wybrow on May 12th, 2008

I’ve watched two videos now on YouTube that report that the creator of the video has written his or her own program that simulates objects with jobs to do that reproduce with random changes, and that these models demonstrate evolution.

I absolutely want to try this.

There would have to be some sort of environment with dangers (and random deaths) and food to gather, which should be limited to stop the population growing. The ‘creatures’ would have to have characteristics that could change randomly from generation to generation, things that affect their ability to gather food or help them avoid the dangers or help them reproduce or increase their life expectancy (overall health).

If anyone wants to help out with this, it’s probably not going to get very much serious attention for a while, but it could be a pretty good ongoing project. You’re invited to share your ideas, because hopefully they’ll help.

Implementation

The specification (below) is being updated as I think of new things, but I find that the best way to think about things is to start doing them. I am presently writing the genderless Creature interface (from which I will implement Male and Female Creatures). I have finished the Environment class - it is now possible to create an environment with a given percentage of Shelter and Food. The Food regenerates at a specified rate per unit of time and every unit of time there is a specified chance of a rainstorm that lasts a specified number of units of time.

Source code available soon!

Specification

  • There must be an Environment that contains all Creatures.
  • The Environment will have a variable size.
  • There are three types of Environment: Food, Land and Shelter.
  • The Environment will have a variable percentage of Shelter.
  • The Environment will force all Creatures to seek Shelter during Rain.
  • The duration and frequency of Rain shall be variable.
  • The Environment will replenish Food at a variable rate.
  • Creatures will consume Food to live.
  • The amount of Food a Creature will consume is a function of its Hunger.
  • A Creature’s Hunger will decrease with time and movement.
  • A Creature will seek food when its Hunger drops below its Minimum Hunger.
  • A Creature’s Minimum Hunger will depend on its Size, Health, Maturity, Intelligence and Food availability.
  • A Creature will cease to seek Food when it exceeds its Maximum Hunger.
  • Creatures will have an Age.
  • Creatures will have a maximum Age, or Life Expectancy.
  • When a Creature’s Age exceeds its Life Expectancy, the Creature will die.
  • A Creature’s Life Expectancy shall be a function of its Size and Strength and Health.
  • A Creature will have good Health when it gets enough Food and Rest.
  • Creatures will interact.
  • Creatures will have a Gender.
  • A Creature will be Male or Female.
  • Creatures can breed.
  • A Creature can breed when its Maturity has passed its Minimum Maturity.
  • A Creature can breed until it reaches its Maximum Maturity.
  • Creatures that are below Minimum Maturity are called Infant.
  • Creatures between Minimum and Maximum Maturity are called Adult.
  • Creatures over Maximum Maturity are called Mature.
  • Mature Creatures or Infant Creatures do not interact with other Mature or Infant Creatures.
  • Adult Male Creatures will have a certain level of Aggressiveness.
  • Adult Female Creatures will have a certain level of Fertility.
  • An Adult Male Creature will interact with an Adult Male Creature by fighting.
  • The likelihood of an Adult Male Creature fighting is determined by a function of its Aggressiveness and its Intelligence.
  • An Adult Female Creature will interact with an Adult Male Creature by breeding.
  • The likelihood of an Adult Female Creature breeding is determined by a function of its Fertility and its Intelligence.
  • An Adult Female Creature will not interact with an Adult Female Creature.
  • An Adult Creature will interact with an Infant Creature by raising it.
  • The likelihood of an Adult Female Creature raising is determined by a function of its Maternalness.
  • The likelihood of an Adult Male Creature raising is determined by a function of its Paternalness.
  • If an Adult Female Creature raises an Infant Male Child, its Maturity will increase (by a function of the Adult’s Maturity) and its Aggressiveness will decrease (by a function of the Adult’s Fertility).
  • If an Adult Female Creature raises an Infant Female Child, its Maturity will increase (by a function of the Adult’s Maturity) and its Fertility will increase (by a function of the Adult’s Fertility).
  • If an Adult Male Creature raises an Infant Male Child, its Maturity will increase (by a function of the Adult’s Maturity) and its Aggressiveness will increase (by a function of the Adult’s Aggressiveness).
  • If an Adult Male Creature raises an Infant Female Child, its Maturity will increase (by a function of the Adult’s Maturity) and its Fertility will decrease (by a function of the Adult’s Aggressiveness).
  • Creatures will have a Size.
  • Creatures will have a Strength that is limited by Size.
  • Both Size and Strength will be generated at birth as a function of the values of the parents’ Size and Strength, with random variation.
  • Size and Strength will increase with Maturity as a function of the Growth Rate, until Maximum Maturity.
  • After Maximum Maturity, Size and Strength will decrease.
  • The rate at which a Creature can gather Food will be a function of its Strength and Intelligence.
  • A Creature’s ability to gather Food will be a function of its Strength and Intelligence.
  • Creatures will need Rest.
  • A Creature’s Rest will decay over time.
  • A Creature can only get Rest by sleeping in Shelter.
  • Creatures will have a Minimum and Maximum Rest, between which is the best place for the Rest value.
  • If a Creature is out of Rest, it will die (from exhaustion).
  • The amount of Rest a Creature will need will be a function of its Size.
  • The model will not use physical location to handle position. Instead, the total Size of the Environment that is not used for Food or Shelter (i.e. Land) will be filled by the total Size of all the Creatures presently on Land space. The chance of an encounter will be the fraction of Land taken up by Creature Size. The encounter will be with a random Creature selected from all Creatures in the Land, so the probability of encountering each kind of Creature will depend on how many of each kind is present.
  • Bred Creatures will have inheritable traits taken from either parent, with random variation applied.
  • Creatures will have a metabolic Growth Rate that will affect how its Size changes with Age and how quickly its Maturity increases (unlike Age which increases uniformly with time periods).

Leave a Reply