Food Chain Model


To model a simple food chain, a number of aspects of the simulation must be defined. These include the environment (physical space in which the agents interact), the agents themselves (and their perception and actuation within the environment), and a set of laws that describe how and when interaction takes place. These elements will be described in the following sections.

Overview

Based upon our discussion of the simple food chain, our simulation will consist of an environment and three types of entities. A plant is a stationary food source that exists within the environment and exists as a food source for herbivores. Herbivores are migratory agents that sense their environment and can eat plants. The predators of herbivores are carnivores that are the other migratory agent within the environment. Carnivores can eat only herbivores, while herbivores can eat only plants. If either agent lives for a certain amount of time within the environment without eating , the agent dies of starvation . When an agent consumes enough food, it is permitted to reproduce which creates a new agent (of the particular type) in the environment. Through reproduction, evolution occurs through the mutation of the agent's brain (simple neural network).

It's important to note that the agents initially have no idea how to survive within the environment. They don't know that eating will allow them to live longer. Nor do they know that they must avoid their predators. All of these details must be experienced and learned by the agents through a simple form of evolution.

The following sections will discuss the elements of the simulation in detail.

Environment

Agents live within a grid world whose edges are connected in a toroid fashion. When an agent moves beyond the edge of a particular dimension, it reappears on the other side (see Figure 7.2).

click to expand
Figure 7.2: Toroid grid world for the food chain simulation.

Plants occupy unique cells within the environment, but it's possible for a single cell to be occupied by one or more agents (herbivore and/or carnivore).

Anatomy of an Agent

An agent is a generic entity within the simulation. It is defined as being a particular type (herbivore or carnivore), but the way it perceives the environment and how it acts upon it are the same (see Figure 7.3). The agent can be thought of as a simple system with a set of inputs (its perception of the world), how it reacts given its perception (its brain), and actuation into the environment (taking its particular action).

click to expand
Figure 7.3: Agent systems model.

The agent, as depicted by Figure 7.3, is made up of three distinct parts . These are sensors, perception (determining which action to take based upon the sensors), and actuation (taking the action). Note that the agent model is reactionary; it simply reacts to the environment. Agents have no capacity to plan, and other than their ability to reproduce, they have no ability to learn. Even with this simple mode, learning occurs through what is known as Larmarckian inheritance. Through reproduction, the characteristics of the parent are passed down to its progeny.

Note  

Jean-Baptiste Lamarck (1744 “1829) proposed an alternate mechanism for evolution than that offered by Charles Darwin. Instead of the process of natural selection driving the gradual improvement of the species, Lamarck believed that heredity, or the inheritance of acquired traits, drove the process.

Sensors

Agents within the environment have the ability to sense what is around them. An agent cannot view the entire environment ”only a set of local cells can be sensed (see Figure 7.4).

click to expand
Figure 7.4: Agent's area of perception ( facing north).

The local environment that the agent can perceive is split up into four separate areas. The area local to the agent is called Proximity and is the area in which the agent can act (such as eating an object). The area in front of the agent (5 cells) makes up the Front. Finally, the two cells at the left and right edges are Left and Right, respectively.

The agent is provided with a numerical count of the objects in view in each of the distinct areas. Therefore, for the four separate areas, three quantities are provided for each to identify the types of objects present (plants, herbivores, and carnivores). This provides twelve inputs to the agent.

Actuators

The agent can perform a limited set of actions within the environment. It can move a single step (in a given direction), turn left or right, or eat an object in its local proximity. The action performed by the agent is provided through its brain, as a function of the inputs provided at the sensory stage.

Agent Brain

The brain of the agent could be one of a variety of different computational constructs. Existing artificial life simulations have used finite automata (state machines), classifier systems, or neural networks. In keeping with the biological motivation of this simulation, we'll use a simple, fully- interconnected , winner-takes-all neural network (as was used in Chapter 5) as the behavioral element of the agent. Figure 7.5 shows a complete network for the agent.

click to expand
Figure 7.5: Winner-takes-all ” neural network as the agent brain.

Recall that sensor inputs represent the count of the objects in view in a particular area. After each of the inputs has been captured from the environment, we propagate these inputs through the network to the outputs. This is done using Equation 7.1.

(7.1)  

In other words, for each output cell ( o j ) in the network, we sum the products of the input cells ( u i ) by the weights of the connections from the inputs cells to the output cells ( w ij ). The bias for the output cell is also added. The result is a set of values in the output cells. The action element of the agent then uses these values.

The initial weights of the agent's neural network are randomly selected, but through reproduction, the weights should become tuned for survival within the environment.

Agent Action Selection

Recall that the agent can perform one of four actions, as defined by the output cells of the neural network. The process of action selection is simply finding the output cell with the largest value and performing this action. This is the "winner-takes-all" aspect of the network. Once the action has taken place, the environment is modified (if warranted by the agent's action) and the process continues.

Energy and Metabolism

Agents survive in the environment given adequate energy. When an agent's internal energy falls to zero, the agent dies. Agents create energy by eating other objects in the environment. An agent can only eat an object that is defined as legal per the food chain. Carnivores can eat only herbivores, and herbivores can eat only plants. Agents also have a metabolism, a rate at which they consume energy to stay alive. Carnivores consume a single energy unit each time step, while herbivores consume two energy units. This means that herbivores must consume twice as much food as carnivores to stay alive . While carnivores do not need to consume as much food, they do have to find it. Herbivores have an advantage in that their food does not move within the environment; however, they must still locate it.

Reproduction

When an agent consumes enough food to reach 90% of its maximum energy, it is permitted to asexually reproduce. Reproduction permits those agents who are able to successfully navigate their environments and stay alive to create offspring (natural selection). By creating offspring, the agents evolve through random mutation of the weights of their neural networks. No learning takes place within the environment, but the capability of an agent to reproduce means that its neural network is passed down to its child. This mimics Lamarckian evolution in which the characteristics of the agent are passed down to the child (the child inherits the neural network of the parent).

When a parent reproduces, it is not without consequences. The parent and the child share the available energy of the parent (cutting the parent's energy in half). This keeps an agent from continually reproducing and provides an implicit timer to avoid continual reproduction of the agent.

Death

Agents can die in one of two ways. Either the agent is unable to find sufficient food to sustain itself and starves to death, or an agent further up the food chain eats it. In either case, the agent in question is removed from the simulation.




Visual Basic Developer
Visual Basic Developers Guide to ASP and IIS: Build Powerful Server-Side Web Applications with Visual Basic. (Visual Basic Developers Guides)
ISBN: 0782125573
EAN: 2147483647
Year: 1999
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net