The program is dependent upon five parameters, plus the size of the rectangular grid. The first parameter is the number of fish, the prey. A fish swims at random to one of the four horizontally or vertically adjacent spaces on the grid, if it is unoccupied. The grid wraps around so a fish can swim off one edge and appear at the opposite edge. The second parameter is the fish breed time. If a fish survives this number of cycles and an open space is available, a new fish is bred. The third parameter is the number of sharks, the predators. A shark eats a fish in an adjacent space on the grid. A shark swims to an open space if there is no adjacent fish. The fourth parameter is the shark starve time. If a shark finds no fish for this number of cycles, it dies. The final parameter is the shark breed time. A shark breeds in the same way as a fish.
If the number of sharks is very small, the fish population will increase quickly and the shark population will soon follow because they find plenty of food. Eventually the fish will become overcrowded and overwhelmed by the large shark population and the fish population will crash. Depending upon the quantity and distribution of sharks at the beginning of the crash, the fish may disappear entirely, the sharks may become isolated and disappear or catastrophe may be narrowly averted.
Studies of small, isolated biological systems that lack diversity have shown similar patterns, though never as simply. The ebb and flow of populations is interesting in itself and there is probably slim evidence to support any particular social or political philosophy.
Fish are green, sharks, red and the background is light blue. The graph shows the numbers of fish and sharks with zero at the bottom and the total number of spaces on the grid at the top. A vertical black line sweeps from left to right moving one pixel each cycle and when it reaches the right edge, wraps around to the left edge. When any of the parameters is altered or the Remix button is pushed, the discontinuity is noted with a vertical white line.
When a breed or starve parameter is altered, each fish and shark receives the new value after it next breeds or eats. When a fish or shark is created, its breed and starve values are randomized somewhat. The numbers of fish and sharks are updated continuously by the program, but may be altered by the user. Whenever the numbers of fish or sharks or the size of the grid is altered, the simulation is remixed.
The geometry of fish and sharks on the grid affects the simulation, and is well mixed initially. This can be done explicitly with the Remix button. The simulation can be paused and restarted with the Stop and Go buttons. Your browser may suspend the program independently when it is scrolled off the screen.
If most of the toolbars and such are cleared away, the entire program can be viewed at once with a high screen resolution, or in two halves in a low resolution.
There is no persistent information associated with this program. There is no record of it after your browser quits.
|wator.java||13,846 bytes||Java source (4 classes)|
|wator.class||6,508 bytes||Top level compiled class|
|panelmap.class||3,641 bytes||Simulation compiled class|
|panelgrf.class||2,187 bytes||Graph compiled class|
|fish.class||1,337 bytes||Fish/shark object compiled class|
Return to Larry's Cerebral Snack Bar