Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 1 2 What is a Cellular Automaton? A one-dimensional cellular automaton (CA) consists of two things: a row of "cells" and a set of "rules". Each of.

Similar presentations


Presentation on theme: "1 1 2 What is a Cellular Automaton? A one-dimensional cellular automaton (CA) consists of two things: a row of "cells" and a set of "rules". Each of."— Presentation transcript:

1

2 1 1

3 2 What is a Cellular Automaton? A one-dimensional cellular automaton (CA) consists of two things: a row of "cells" and a set of "rules". Each of the cells can be in one of several "states". The number of possible states depends on the automaton. Think of the states as colors. In a two-state automaton, each of the cells can be either black or white. Over time, the cells can change from state to state. The cellular automaton's rules determine how the states change. It works like this: When the time comes for the cells to change state, each cell looks around and gathers information on its neighbors' states. (Exactly which cells are considered "neighbors" is also something that depends on the particular CA.) Based on its own state, its neighbors' states, and the rules of the CA, the cell decides what its new state should be. All the cells change state at the same time.

4 3 3 Black = White 2 Black = Black 1 Black = Black 3 White = White Now make your own CA

5 4 2-Dimensional Automata 2-dimensional cellular automaton consists of an infinite (or finite) grid of cells, each in one of a finite number of states. Time is discrete and the state of a cell at time t is a function of the states of its neighbors at time t-1.

6 5 Conway’s Game of Life The universe of the Game of Life is an infinite two- dimensional grid of cells, each of which is either alive or dead. Cells interact with their eight neighbors.

7 6 6 Example of a Cellular Automata: Conway’s Life (Gardner, 1970)

8 7 Conway’s Game of Life At each step in time, the following effects occur: 1.Any live cell with fewer than two neighbors dies, as if by loneliness. 2.Any live cell with more than three neighbors dies, as if by overcrowding. 3.Any live cell with two or three neighbors lives, unchanged, to the next generation. 4.Any dead cell with exactly three neighbors comes to life. The initial pattern constitutes the first generation of the system. The second generation is created by applying the above rules simultaneously to every cell in the first generation -- births and deaths happen simultaneously. The rules continue to be applied repeatedly to create further generations.

9 8 Applications of Cellular Automata Simulation of Biological Processes Simulation of Cancer cells growth Predator – Prey Models Art Simulation of Forest Fires Simulations of Social Movement …many more.. It’s a very active area of research.

10 9 Cellular Automata: Life with Simple Rules Sharks and Fish: Predator/Prey Relationships Cellular automata can be used to model complex systems using simple rules. Key features* divide problem space into cells each cell can be in one of several finite states cells are affected by neighbors according to rules all cells are affected simultaneously in a generation rules are reapplied over many generations

11 10 Main idea Model predator/prey relationship by CA Define set of rules Begins with a randomly distributed population of fish, sharks, and empty cells in a 1000x2000 cell grid (2 million cells) Initially, –50% of the cells are occupied by fish –25% are occupied by sharks –25% are empty

12 11 Here’s the number 2 million Fish: red; sharks: yellow; empty: black

13 12 Rules A dozen or so rules describe life in each cell: birth, longevity and death of a fish or shark breeding of fish and sharks over- and under-population fish/shark interaction Important: what happens in each cell is determined only by rules that apply locally, yet which often yield long-term large-scale patterns.

14 13 Do a LOT of computation! Apply a dozen rules to each cell Do this for 2 million cells in the grid Do this for 20,000 generations Well over a trillion calculations per run! Do this as quickly as you can Initially cells contain fish, sharks or are empty Empty cells = 0 (black pixel) Fish = 1 (red pixel) Sharks = –1 (yellow pixel)

15 14 Rules in detail: Breeding Rule Breeding rule: if the current cell is empty If there are >= 4 neighbors of one species, and >= 3 of them are of breeding age, »Fish breeding age >= 2, »Shark breeding age >=3, and there are <4 of the other species: then create a species of that type »+1= baby fish (age = 1 at birth) »-1 = baby shark (age = |-1| at birth)

16 15 Breeding Rule: Before EMPTY

17 16 Breeding Rule: After

18 17 Rules in Detail: Fish Rules If the current cell contains a fish: Fish live for 10 generations If >=5 neighbors are sharks, fish dies (shark food) If all 8 neighbors are fish, fish dies (overpopulation) If a fish does not die, increment age

19 18 Rules in Detail: Shark Rules If the current cell contains a shark: Sharks live for 20 generations If >=6 neighbors are sharks and fish neighbors =0, the shark dies (starvation) A shark has a 1/32 (.031) chance of dying due to random causes If a shark does not die, increment age

20 19 Shark Random Death: Before I Sure Hope that the random number chosen is >.031

21 20 Shark Random Death: After YES IT IS!!! I LIVE

22 21 Programming logic Use 2-dimensional array to represent grid At any one (x, y) position, value is: –Positive integer (fish present) –Negative integer (shark present) –Zero (empty cell) –Absolute value of cell is age

23 22 Parallelism A single CPU has to do it all: –Applies rules to first cell in array –Repeats rules for each successive cell in array –After 2 millionth cell is processed, array is updated –One generation has passed –Repeat this process for many generations –Every 100 generations or so, convert array to red, yellow and black pixels and send results to screen

24 23 Parallelism How to split the work among 20 CPUs –1 CPU acts as Master (has copy of whole array) –18 CPUs act as Slaves (handle parts of the array) –1 CPU takes care of screen updates Problem: communication issue concerning cells along array boundaries among slaves

25 24 Send Right Boundary Values

26 25 Receive Left Boundary Values

27 26 Send Left Boundary Values

28 27 Receive Right Boundary Values

29 28 Send Right Boundary Values

30 29 Receive Left Boundary Values

31 30 Send Left Boundary Values

32 31 Receive Right Boundary Values

33 32 At intervals, update the master CPU has copy of entire array

34 33 Illustration Next several screens show behavior over a span of 10,000+ generations (about 25 minutes on a cluster of 20 processors )

35 34 Generation: 0

36 35 Generation: 100

37 36 Generation: 500

38 37 Generation: 1,000

39 38 Generation: 2,000

40 39 Generation: 4,000

41 40 Generation: 8,000

42 41 Generation: 10,500

43 42 Variations of Initial Conditions Still using randomly distributed populations: –Medium-sized population. Fish/sharks occupy: 1/16 th of total grid Fish: 62,703; Sharks: 31,301 –Very small population. Fish/sharks occupy: 1/800 th of total grid Initial population: Fish: 1,298; Sharks: 609

44 43 Generation 10020001000 40008000 Medium-sized population (1/16 of grid) Random placement of very small populations can favor one species over another Fish favored: sharks die out Sharks favored: sharks predominate, but fish survive in stable small numbers

45 44 Very Small Populations Random placement of very small populations can favor one species over another Fish favored: sharks die out Sharks favored: sharks predominate, but fish survive in stable small numbers

46 45 Elementary Cellular Automata As before think of every cell as having a left and right neighbor and so every cell and its two neighbors will be one of the following types Replace a black cell with 1 and a white cell with 0 111 110 101 100 011 010 001 000 Every yellow cell above can be filled out with a 0 or a 1 giving a total of 2 8 =256 possible update rules.

47 46 This allows any string of eight 0s and 1’s to represent a distinct update rule Example: Consider the string 0 1 1 0 1 0 1 0 it can be taken to represent the update rule 1 1 1 1 1 0 1 0 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 0 01101010 Or equivalently Now think of 01101010 as the binary expansion of the number 0 2 7 + 1 2 6 + 1 2 5 + 0 2 4 +1 2 3 + 0 2 2 + 1 2 1 + 0 2 0 = 64+32+8+2=106. So the update rule is rule # 106

48 47 Rule #45=32+8+4+1 = 0 2 7 + 0 2 6 + 1 2 5 + 0 2 4 +1 2 3 + 1 2 2 + 0 2 1 + 1 2 0 =0 0 1 0 1 1 0 1 Rule #30=16+8+4+2 = 0 2 7 + 0 2 6 + 0 2 5 + 1 2 4 +1 2 3 + 1 2 2 + 1 2 1 + 0 2 0 =0 0 0 1 1 1 1 0 This naming convention of the 256 distinct update rules is due to Stephen Wolfram. He is one of the pioneers of Cellular Automata and author of the book a New Kind of Science, which argues that discoveries about cellular automata are not isolated facts but have significance for all disciplines of science.

49 48 Computer processors CA processors are a physical, not software only, implementation of CA concepts, which can process information computationally. Processing elements are arranged in a regular grid of identical cells. The grid is usually a square tiling, or tessellation, of two or three dimensions; other tilings are possible, but not yet used. Cell states are determined only by interactions with the small number of adjoining cells. Cells interact, communicate, directly only with adjoining, adjacent, neighbor cells. No means exists to communicate directly with cells farther away. Cell interaction can be via electric charge, magnetism, vibration (phonons at quantum scales), or any other physically useful means. This can be done in several ways so no wires are needed between any elements.

50 49 APPLICATIONS Study of how genetic algorithms can evolve cellular automata to perform computations that require global coordination –emergent computation - actions of simple components with local information and communication produce coordinated global information processing –insect colonies, economic systems, the immune system, the brain, networked systems,...

51 50 1-d Binary State CAs One dimensional lattice of N two-state machines (cells) –each changes its state as a function only of the current states in a local neighborhood 10100111010 T=0 RULE TABLE: Neighborhood: 000 001 010 011 100 101 110 111 Output bit: 0 0 0 1 0 1 1 1 01000111101 Size r = 1 neighborhood (nearest-neighbor) T=1

52 51 Computational Tasks A useful test problem for emergent computation is the density-classification task –if the initial configuration (IC) of cell states has a majority of 1’s then it should go to the fixed-point configuration of all 1’s in M steps, otherwise it should produce the fixed-point configuration of all 0’s in M steps –this is called the p c = 1/2 task if p 0 is the density of 1’s in the IC then the all 1’s configuration should occur when p 0 > p c –Is there a CA rule that will produce this behavior? –With only local information this is hard

53 52 Example GA On-going work at Santa Fe Institute by Mitchell, et. al. Initial attempts –GOAL: Search for a r=3 CA rule to perform the p c = 1/2 task –Use a CA with N=149 cells

54 53 Representation The GA rule structure consisted of the output bits of the rule table in binary order –bit 0 is the rule for the 0 0 0 0 0 0 0 neighborhood, bit 1 is the output rule for the 0 0 0 0 0 0 1 neighborhood, etc –chromosome size is 128 bits

55 54 Fitness Each rule in the population was run on a sample of 100 ICs randomly choosen –each CA was run until it arrives at a fixed point or for a maximum of M = 2N steps –fitness was the fraction of ICs which produced the correct final behavior –A different sample was selected at each generation –the random sample was biased to insure that the density of 1’s varied from 0 to 1

56 55 Parent Selection The population size was set at 100 The CAs were ranked in order of fitness The top 20% (elite rules) were passed to the next generation without modification The remaining 80% of the new population were produced using crossover between parents randomly selection from the elite rules

57 56 CrossOver/Mutation Single point crossover was used the offspring from each crossover were each mutated at exactly two randomly chosen positions

58 57 Results Each GA ran for a maximum of 100 generations While no general rule was discovered, the GA did find rules that worked on about 75% of the ICs


Download ppt "1 1 2 What is a Cellular Automaton? A one-dimensional cellular automaton (CA) consists of two things: a row of "cells" and a set of "rules". Each of."

Similar presentations


Ads by Google