Male Female

ecosystem
Class: Nature of Code

Professor: Daniel Shiffman

A simulations of male and female behavior using flocking and attraction rules.

The idea is to show an interesting behavior that fish demonstrate...
Females are attracted to large males.
But if a male has a female alongside it they will choose him over a larger male who is alone.

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: MaleFemaleKids | Boid | BoidSystem | Female | Male | scrollMale

How it was done / more details

  • If a female is next to a male, she will follow him
  • If another male is close by and he has other females following him already, the female will flock towards that male

Eventually the system tends to a few males being followed by several females.