Ecosystem

ecosystem
Class: Nature of Code

Professor: Daniel Shiffman

A simulation of reproduction using flocking behaviors, attraction between genders, hunger, size, and agility.

Documentation/Media

To view this content, you need to install Java from java.com

Written in Java using Processing as a "wrapper" and some libraries created by Daniel Shiffman.
Source code: ecosystem | DNA | Food | FoodPS | Thing | ThingPS

How it was done / more details

  • Males and Females are attracted to food and to each other.
  • If they are mating, they cannot eat.
  • If they eat, they grow and become slower.
  • The have to be close to another member of the opposite sex to pair up and go to the mating area.
  • Their kids will inherit some properties from the parents:
    • How horny or how hungry they are (inversely proportional).
    • How fast they go and how big they are (also inversely proportional)
  • These factors influence how much food the eat, how fast they get to the mating area, how attracted they are to members of the opposite sex, and how long they live.
  • The mating are is where they have kids. The kids inherit the properties of the parents.
  • Eventually the population tends to an "optimal" level of horniness, hunger, speed and size - since only those with the right genes will reproduce.