Firefly Sanctuary: Documentation

Firefly Metabolism
Firefly Behaviors
Firefly Mating in Detail
Predator Metabolism
Predator Behaviors
Food Metabolism
Manipulating the Firefly Genome

Firefly Metabolism:

Fireflies spawned at beginning of the simulation have 100 mass. At each iteration, each firefly loses 0.5 mass.

Living Criteria: If a firefly's mass goes below 30, the firefly dies.

Swarm Criteria: the mass of a firefly above which swarming is possible. Fireflies below this mass do not swarm, which makes them look for food. Initialized at 70 +/- 10%.

Feeding Cutoff: the mass of a firefly below which feeding is possible. Fireflies above this mass are too full to eat any more. Initialized at 110 +/- 10%.

Mating Criteria: the mass of a firefly above which mating is possible. Fireflies below this mass are "young" and cannot mate. Initialized at 100 +/- 10%.

Firefly Behaviors (listed in order of priority) :

Out of Bounds: if a firefly moves outside of the designated boundary, it is placed at the edge of the boundary.

Flee: if a firefly is close to a predator, it moves in the opposite direction it was moving. This is almost always the complement of the vector it used in the last wandering process.

Feed: if a firefly is below its feeding cutoff and is near food, it eats the food. How much mass the firefly gains is directly proportional to the mass of the food.

Mate: if a firefly is above its mating criteria, and in a swarm, and near a potential mate who is also above their mating criteria, the firefly mates with the target firefly.

Swarm: if a firefly is above its swarming criteria, and near another firefly, it slows down and hovers. While swarming, the firefly experiences a reduced mass loss at each iteration. Thus, a firefly can survive longer without food if it swarms.

Wander: a random x and y value are used to generate a random vector. The firefly then moves in this direction. The magnitude of the wandering is controlled by a variable that can be manipulated during the simulation using the sliders in the top panel.

Firefly Mating in Detail:

A firefly must be above its mating criteria, and in a swarm, and near a potential who is also above their mating criteria to mate. The former is designated the active mate, and the latter the passive mate. When two fireflies mate:

- both fireflies lose 40% of their mass
- their child's mass is equal to 30% of their masses combined.
- the child's swarming criteria is equal to that of the active mate's swarming criteria +/- 2.
- the child's feeding criteria is equal to that of the passive mate's feeding criteria +/- 2.
- the child's mating criteria is equal to that of the active mate's mating criteria +/- 2.
- the child is positioned between its parents.

Predator Metabolism:

Predators do not gain or lose mass, nor do they die.

Predator Behaviors (listed in order of priority):

Out of Bounds: if a predator moves outside of the designated boundary, it is placed at the edge of the boundary.

Feed: if a predator comes close enough to a firefly, it eats the firefly.

Wander: a random x and y value are used to generate a random vector. The predator then moves in this direction. The magnitude of the wandering is controlled by a variable that can be manipulated during the simulation using the sliders in the top panel.

Food Metabolism:

Food is generated at the beginning of the simulation with random masses. Food can either be young or mature. The duration of the young stage is randomized. Food can only be eaten by fireflies when it is mature.

When food is eaten, a new food instance is generated elsewhere on the map in the young stage.

Manipulating the firefly genome:

The firefly genome is composed of 3 numbers: the swarming criteria, the feeding cutoff, and the mating criteria.

To access a firefly's genome: you can click directly on the firefly and its name and genome will appear in the genome panel. Or, if you want to know the genome of a firefly whose name you know, you can type that name in the genome panel, and click "show".

To calculate the average genome: you can click on "calc" in the Genome panel and the average of the firefly genome will be reported. Only fireflies that are alive will be included in this average.

To clone a firefly: click on the target firefly to get its genome. Then click on "create" in the Genome panel. The firefly will be spawned in the center of the map.

To create a firefly with a specified genome: enter the numbers desired in the Genome panel in the first column and then click "create".