24
Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Embed Size (px)

Citation preview

Page 1: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Predator/Prey Simulation for Investigating Emergent

Behavior

Jay Shaffstall

Page 2: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Introduction

Overview of emergent behavior

Evolution & emergent behavior

Predator/Prey simulation

Outcomes

Page 3: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Emergent Behavior

An emergent behavior is a behavior that is not programmed into the system.

An emergent behavior evolves over time from more primitive behaviors.

The classic example: ant colony

Page 4: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Emergent Behavior

The ant colony looks like it is strongly organized…each ant does a job to keep the colony healthy.

In reality, each ant is responding to local rules. Each ant decides what to do next based on what is in its immediate area.

An ant has no concept of the colony.

Page 5: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Emergent Behavior

So emergent behavior is behavior that arises from the interaction of a lot of local behaviors.

Another example is how cities seemingly organize into neighborhoods, even though each individual is making decisions based on what is best for them.

Page 6: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Evolution & Emergent Behavior

Evolution allows a population to adapt to its environment over time. Environmental pressureCharacteristicsNatural selectionEvolution is the process of a species adapting to environmental changesDoes nothing for the individual

Page 7: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Evolution & Emergent Behavior

Over time, individuals may start to cooperate in local ways.

This local cooperation leads to emergent behavior, in which widely separated individuals appear to be working toward the same purpose

Page 8: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Predator/Prey Simulation

A predator/prey simulation provides a simple environment in which evolution can happenThere are three types of organisms in the simulationPlantsPreyPredators

Page 9: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Predator/Prey Simulation

Each organism has its own genetic structure.

One gene for the prey, for example, might control how far the prey can move in one action

Each organism also has rules for how it interacts with its local environment

Page 10: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Predator/Prey Simulation

Each organism can breed to produce more organisms. The organisms that live long enough to breed are considered to be “fit”, and pass on their genetic characteristics to their children.Over time, the children become more and more “fit”

Page 11: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Predator/Prey Simulation

Stages of developmentEnvironment

Invasive plants

Crippled prey

Nice predators

No more lemmings

A complete simulation

Page 12: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Predator/Prey Simulation

Goals of the simulation:Provide an environment in which evolution could take place for predators and prey

See what emergent behaviors come out of the local behaviors

Page 13: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Outcomes

The first non-testing run of the simulation took about 15 hours, and generated around 10 gigabytes of data.

Let’s look at a sample of the displays. This sample is from the 8th step of the simulation.

Page 14: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall
Page 15: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall
Page 16: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Outcomes

That was from the 8th step, where we still have the initial random distribution of animals and plants.

Let’s look at a display from the 5600th step, about 15 hours later.

Page 17: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall
Page 18: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Outcomes

But what happened between those steps? Did evolution take place?

Let’s look at a population graph for that run.

Page 19: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Predator/Prey Populations

020000400006000080000

100000120000

146

592

913

9318

5723

2127

8532

4937

1341

7746

4151

0555

69

Cycle

Popu

lation

Plants

Prey

Predators

Page 20: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Outcomes

Clearly, evolution did not take place.So, when the program doesn’t work like you expected, you find out why.The big question is why didn’t the prey population increase when the plant population increased?Consider this zoomed in part of the 5600th step.

Page 21: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall
Page 22: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Outcomes

The failure of prey to reproduce is the key problem with the simulation as it is written.

Because of that, we do not see evolution

Without evolution, we don’t see emergent behavior

Page 23: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Conclusion

I set out to write a simulation to investigate emergent behavior

Much bigger project than I thought, but also a lot of fun

I recommend future students to look at projects dealing with emergent behavior

Page 24: Predator/Prey Simulation for Investigating Emergent Behavior Jay Shaffstall

Conclusion

To learn from my mistakes:

Capstone paper available at

http://cs.franklin.edu/~shaffsta/paper.zip