Rabbit+Model

Purpose
The model was designed to simulate the behaviors of a small mammal, in this case a rabbit, in an environment with limited food resources. The model also demonstrates the effects of certain assumed behaviors, including territoriality and cooperation for the purpose of creating offspring.

Entities, State Variables, and Scales
The model has two kinds of entities: rabbits and land patches. The land patches make up a square grid landscape of 41x41 patches and can be in one of three states. Rabbits are characterized by six variables. The simulation lasts until the number of rabbits decreases to zero or is ended by the observer.
 * grass: Patch has grass on it.
 * weeds: Patch has weed on it.
 * empty: Patch has neither grass nor weed on it.
 * energy: Amount of energy the rabbit has, used for mating, fighting, and moving.
 * gender: Gender of the rabbit.
 * lifetime: How much time the rabbit has before it dies.
 * last_mate: The last female rabbit a male rabbit mated with.
 * pregnant: Whether a female rabbit is pregnant or not.
 * fought: Whether a rabbit has already fought for territory during the current timestep.

Process Overview and Scheduling
At the beginning of every timestep, empty land patches are randomly selected to grow either grass or weeds. Then, all rabbits are asked to perform the following operations.
 * move: Move in a random direction to a new patch. This consumes energy.
 * reproduce: Reproduce if a mate is available and energy levels permit.
 * fight: If multiple rabbits occupy the same patch, the rabbits randomly fight others of the same gender to reduce their energy and hopefully quicken their demise.
 * eat-grass: If the patch currently occupied by a rabbit has grass, the first rabbit that gets called will eat the grass.
 * lifetime: The remaining life of the rabbit is decreased by one increment.
 * death: If a rabbit’s energy or health is at or below zero, the rabbit dies.

Design Concepts
The basic principle of this model revolves around the availability of food and the random encounters between rabbits of differing genders to allow them to eat and breed and thus continue the species. Because the movement of the rabbits is completely random, encounters between rabbits are left purely to chance.

Initialization
The landscape is randomly initialized with as either of grass, weeds, or empty. A number of rabbits is created and dispersed randomly on the landscape, with the energy, gender, and lifetime values randomly set.

Input Data
There is no input data.

Submodels
The reproduce submodel determines whether a rabbit will reproduce. All male rabbits will seek mates that are one patch away or closer from his current position. If the female rabbit has enough energy to reproduce, she becomes pregnant. Male rabbits remember who their last mate was. Female rabbits that become pregnant will give birth to a new rabbit in the next timestep. The eat-grass submodel determines whether a rabbit will be able to eat the grass it currently stands on. If a male rabbit shares a patch with the female he last mated with, and if that female is pregnant, the male rabbit will forgo his meal if doing so ensures the female survives long enough to give birth and the male rabbit himself does not perish in the next timestep. The fight submodel determines, if a rabbit shares the patch with others of its own gender, with whom a rabbit would fight with to try and reduce competition for mates and food. In addition, a rabbit will not fight another rabbit that has already fought during the current timestep. If multiple potential opponents possess the three criteria of shared patch, gender, and not having fought yet, one is selected at random to be the current rabbit’s opponent.