Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cellular Automata Introduction  Cellular Automata originally devised in the late 1940s by Stan Ulam (a mathematician) and John von Neumann.  Originally.

Similar presentations


Presentation on theme: "Cellular Automata Introduction  Cellular Automata originally devised in the late 1940s by Stan Ulam (a mathematician) and John von Neumann.  Originally."— Presentation transcript:

1

2 Cellular Automata

3 Introduction  Cellular Automata originally devised in the late 1940s by Stan Ulam (a mathematician) and John von Neumann.  Originally devised as a method of representing a stylized universe, with rules (e.g. laws of thermodynamics) acting over the entire universe.  Have subsequently been used for a wide variety of purposes in simulating systems from chemistry and physics  CAs have started to be used in bioinformatics

4 Some Facts  Cellular Automata but … one Automaton !!  Cellular Automata can be defined in multiple dimensions: one, two, three… or more  Cellular Automata have applications in many scientific domains: 1.Physics 2.Material Science 3.Biology 4.Epidemiology 5.etc

5 Cellular Automata  CA is a dynamical system in which space and time are discrete and the space of Cellular automata is changed with time

6 Cellular Automata CA is a spatial lattice of N cells, each of which is one of k states at time t. Each cell follows the same simple rule for updating its state. The cell's state s at time t+1 depends on its own state and the states of some number of neighbouring cells at t. For one-dimensional CAs, the neighbourhood of a cell consists of the cell itself and r neighbours on either side.

7 Cellular Automata  An automaton consists of a grid/lattice of cells each of which can be in a number of states  The figure shows a 5x5 automaton where each cell can be in a filled or empty state. Cell State = empty/off/0 State = filled/on/1

8 1-D Cellular Automata It is a string of cells (one dimensional array of cells). Each cell in one state of State Set and change its state with time depend on the neighbor cells.

9 1D Cellular Automata 100101010100 T=0 011000111101 T=1

10 Application  1-D cellular Automata example is the Traffic road (system)  Let us consider the cell with state 0 is empty of car and cell with state 1 has a car

11 Traffic Road 111111 T=0 111111 T=1

12 Traffic road  The idea is to consider a set of adjacent cells representing a street along which a car can move.  The car jumps to its nearest neighbor cell unless this cell is already occupied by another car.

13 Traffic System The rule of motion can be expressed by X (t+1) = X in (t) (1-X(t)) + X out (t) X(t) X is the cell, X in is the cell from which the car come, X out the destination cell.

14 Traffic Simulation  Decelerate, if tailing distance to the next car is less than strength of pheromone suggests  Accelerate, if there is no pheromone or tailing distance is greater than suggested by pheromone strength

15 Traffic Simulation  Driving, changing lanes, stopping

16 State Set Each cell of the cellular automata is a finite automaton and then it has a state, the set of all possible states is called state set

17 State Transition Rules  The states of an automaton change over time in discrete timesteps  The state of each cell is modified in parallel at each timestep according to the state transition rules  These determine the new states of each of the cells in the next timestep from the states of that cells neighbours For (int i=0 to CellCount) { Cell[i].State[t+1] = STR(Cell[i].Neighbour.State[t] }

18 Boundary conditions there are two kinds of boundaries; periodic and fixed value boundaries. 1.Periodic boundary is obtained by periodically extending the array or lattice 2.Fixed value boundary is obtained by simply prescribing a fixed value for the cells on the boundary 100101010100

19 Neighborhood size The set of cells that neighbor a given cell X in traffic example, the neighborhood size is 3 ( cell before and cell after plus the cell X itself) 101

20 2-D Cellular Automata  Is an array nxn of cells. Each cell has a different state from state set. 10101 11011 01101 01110 10010

21 2 D Cellular Automata  The neighborhood size of 2D cellular Automata is 2 types: Von Neuman and Moore R=1R=2 Von Neuman

22 2 D Cellular Automata  The neighborhood size of 2D cellular Automata is 2 types: Von Neuman and Moore R=1R=2 Moore

23 2-D Traffic System  Using 2 D cellular Automata we can construct road networks with crossing where cars can move

24 Game of life  Consider 2D cellular automata with neighbors size 8 and states 0 and 1  The transition rule is: –If cell has 3 of its neighbors live, then it live next time –Live cell and has 2 neighbors live, it will be live next time –Otherwise, it will die next time step

25 Game of life

26

27

28

29

30 Is it alive?

31 Sequences

32 Loop Reproduction

33 Loop Death

34 Classes of cellular automata (Wolfram) Class 1: after a finite number of time steps, the CA tends to achieve a unique state from nearly all possible starting conditions (limit points) Class 2: the CA creates patterns that repeat periodically or are stable (limit cycles) Class 3: from nearly all starting conditions, the CA leads to aperiodic-chaotic patterns, where the statistical properties of these patterns are almost identical (after a sufficient period of time) to the starting patterns (self-similar fractal curves) – computes ‘irregular problems’ Class 4: after a finite number of steps, the CA usually dies, but there are a few stable (periodic) patterns possible (e.g. Game of Life) - Class 4 CA are believed to be capable of universal computation

35 The 2 million cell  Fish: red; sharks: yellow; empty: black

36 Initial Conditions Initially cells contain fish, sharks or are empty  Empty cells = 0 (black pixel)  Fish = 1 (red pixel)  Sharks = –1 (yellow pixel)

37 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)

38 Breeding Rule: Before EMPTY

39 Breeding Rule: After

40 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

41 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

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

43 Shark Random Death: After YES IT IS!!! I LIVE

44 Generation: 0

45 Generation: 100

46 Generation: 500

47 Generation: 1,000

48 Generation: 2,000

49 Generation: 4,000

50 Generation: 8,000

51 Generation: 10,500

52 Application Guidelines  To apply a cellular automaton to a problem: –A representation of a cell must be determined –Cell states must be defined –A grid of cells must be constructed –A set of rules must be created to modify states –A neighbourhood should be defined

53 Reaction/Diffusion with Cellular Automata

54 CA Methods in Games SimCity 2000 The SIMS


Download ppt "Cellular Automata Introduction  Cellular Automata originally devised in the late 1940s by Stan Ulam (a mathematician) and John von Neumann.  Originally."

Similar presentations


Ads by Google