11.4 Rules of the Game

Our computer simulation models a world that contains two types of life-forms: bears and fish. We can think of this world as a two-dimensional “grid” with a fixed size for each dimension. Life-forms are able to live only at specific locations within the grid.

Each life-form is described by a set of rules that governs how it lives. Initially, a group of life-forms will be placed in the world at random locations. The simulation will progress by allowing one of the life-forms to live for one time unit. During this unit of time, all other life-forms are in “suspended animation.” Thus, at any given time, the life-form is in one of two states: (1) alive or (2) suspended. The particular life-form is chosen at random from the collection of all possible life-forms. Each time a life-form is in the alive state, it must reevaluate its surroundings because the rest of the world will likely have changed during the previous time units when it was suspended. In this way, the simulation takes on a sense of reality.

When a fish is alive, it is allowed to breed, move, and die. Once a fish has been in the alive state 12 times, it may attempt to breed. To do so, it randomly picks an adjacent location. If that location is empty, a new fish appears. If the location is occupied, the fish must wait until the next time and try again.

Regardless of whether a fish breeds, it will next try to move. When a fish moves, it randomly picks an adjacent location. If that location is empty, the fish moves to this new location. If the location is occupied, the fish remains in its current location.

One additional environmental characteristic that will affect fish is overcrowding. If a fish discovers that two or more other fish are living adjacent to its own space, then the fish will die. Thus, even in the complete absence of bears, fish will self-regulate their population size to some extent. In addition, in this version of the simulation, fish never need to eat.

When a bear is alive, it is allowed to breed, move, eat, and die. Breeding takes place in much the same fashion as described previously for fish. The only difference is that bears need to be in the alive state eight times before they can start breeding. Bears moves in exactly the same manner as fish.

Bears are not impacted by overcrowding, but they do need to eat. To eat, a bear must determine whether fish are living in an adjacent location. If so, then the bear randomly picks one of the fish and “eats” it. To consume the fish, the bear moves to the location currently occupied by the chosen fish. If there are no adjacent fish, the bear begins to starve. Any bear that has been in the alive state and starving 10 times in a row will die.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.105.84