User:Davidsac/Sandbox

Wa-Tor is a cellular automaton devised by Alexander Keewatin Dewdney and presented in the December 1984 issue of Scientific American.

Wa-Tor
The article entitled "Computer Recreations: Sharks and fish wage an ecological war on the toroidal planet Wa-Tor", in fact describes an ecosystem as a cellular automaton itself. Wa-Tor is a planet completely covered by water in which co-exists in a delicate balance, between only 2 species. The planet is toroidal, i.e. If a living being moves down passed the bottom of the world, it reappears at the upper edge, similarly, if they go out to the right, they will reappear on the left. The first are called "sharks" for their resemblance to the homonymous species on earth, while the latter are generally called "fish". The first species are predatory and eat the second. Both sharks and fish live, move, reproduce and die in Wa-Tor according to the rules defined below. Time passes in discrete steps which Dewdney calls "chronons".

The evolution of Wa-Tor
The balance of this ecosystem is very delicate: the populations of two species can follow hugely different cycles depending on the given parameters(such as reproduction cycles and the time period in which a shark must eat to avoid starvation) as well as starting positions of each being. We may go from both species being endangered to an abundance of one or both. In a small way, Wa-Tor simulates what really happens in nature, showing the evolution of the population of a species and its natural predator, and the bond that binds them.

When the prey are numerous, predators can reproduce rapidly. But this increase in turn increases the number of prey hunted and the population of the prey decreases. By becoming rarer prey, predators begin to starve and die of starvation, decreasing their population and easing the pressure on hunting prey. The prey (and in time predator) can then go back to rapidly reproducing as the cycle repeats itself.

Rules
Wa-Tor is represented by a rectangular array. Each cell in the array can be empty or contain a contain a fish or a shark.

All activities are conducted in accordance with time (chronons): at each chronons the state of Wa-Tor, i.e. the cells of the matrix that represent it, are updated and both fish and sharks make their actions. Fish can move or reproduce, while sharks may move, hunt or reproduce. All movement operations, hunting and reproduction must always be randomly chosen among the possible alternatives.

Rules for the fish

 * 1) For any amount of time, the fish move randomly in one of the adjacent squares, if that square is free, i.e. contains no sharks or fish. If there are no free boxes, no movement takes place.
 * 2) Once the fish has survived a certain number of chronons it may reproduce. This is done as it moves to a neighbouring square(described above), leaving behind a new fish in it's previous position and it's own reproduction time is reset to zero.

The following image provides a graphical representation of these rules.

Rules for sharks

 * 1) At each chronons, sharks move randomly into one of the adjacent squares, if there are no sharks in it. If no adjacent box is free, no movement takes place.
 * 2) At each chronons, each shark is deprived of a unit of energy.
 * 3) If the shark moves to a square occupied by a fish, the shark eats the fish and earns a certain amount of energy.
 * 4) If the energy exceeds a certain "reproduction threshold", the shark gives birth to another shark in a free adjacent cell, as long as there is one. When this happens, its energy is split in half with their offspring.
 * 5) If the energy level of a shark drops below zero, the shark dies.

The following image provides a graphical representation of these rules.

Possible Results
In the long run there are only 3 possible scenarios in Wa-Tor:
 * 1) A perfect balance between fish and sharks, which increase and decrease but never become extinct.
 * 2) Disappearance of sharks.
 * 3) Extinction of both species.

The first scenario can be very difficult to obtain, where a kind of equilibrium is achieved in which the two populations fluctuate periodically. In most cases, the amount of fish is reduced to an almost endangered state, then the shark population rapidly falls due to shortage of food. This allows the fish population to grow again until the shark population can meet this growth.

The extinction of both animals occurs when sharks exceed in number to a point where they eat all the fish. As the fish were the only source of food for sharks they will inevitably die of starvation.

Conversely, if the initial number of fish is low, or the sharks have a very short period of starvation, the second scenario occurs. In this case the sharks will become extinct, leaving the field open to the fish.