Wa-Tor#

Application Image OSI Certified Python Powered

Wa-tor is a simulation of sharks and fish waging an ecological war on the torodial world of Wa-tor. It was first proposed by A. K. Dewdney in the December 1984 issue of Scientific American.

Environment#

  • The world is a toroid that is displayed as a rectangular grid.

    • The top and bottom edges are joined to each other: moving off the top edge puts a shark or fish on the bottom edge.

    • The left and right edges are joined to each other: moving off the right edge puts a shark or fish on the left edge.

  • An initial number of shark and fish are randomly placed in the world.

  • Sharks and fish have a gestation period which is the number of turns before reproduction.

  • Sharks have a starvation period which is the number of turns must eat before the shark dies.

Behavior Rules (each round)#

Fish#

  • A fish moves in a random direction: north, south, east, or west if the location is clear.

  • If a fish moves and gestation period has expired then a new fish is left in the previous location.

  • If a fish reproduced then the gestation clock is reset.

Shark#

  • A shark randomly chooses a location to move first from locations that have fish, and if no fish from empty locations.

  • If the location has a fish then the shark eats the fish and the hunger clock is reset.

  • If a shark moves and gestation period has expired then a new shark is left in the previous location.

  • If a shark reproduced then the gestation clock is reset.

  • If a shark’s hunger clock expires then the shark dies.

References#

A. K. Dewdney. Computer recreations: Sharks and fish wage an ecological war on the toroidal planet wa-tor. Scientific American, 251(6):14–22, Dec. 1984. ISSN 0036-8733. Description of program for simulating predator-prey dynamics.

License#

wator.py is © 2006, Lance Finn Helsten.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>_

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.