Cellular Automata - PowerPoint PPT Presentation

1 / 66
About This Presentation
Title:

Cellular Automata

Description:

Title: Procedur lne Modelovanie Author: Enam Last modified by: Enam Created Date: 9/18/2003 3:44:43 PM Document presentation format: On-screen Show – PowerPoint PPT presentation

Number of Views:119
Avg rating:3.0/5.0
Slides: 67
Provided by: Enam
Category:

less

Transcript and Presenter's Notes

Title: Cellular Automata


1
Cellular Automata
2
Cellular Automata?
  • CA are computer simulations that try to emulate
    the way the laws of nature are supposed to work
    in nature.
  • They can help us explore if the reductionist
    approach that scientific research has taken is
    actually realistic.

3
Why CA?
  • Can we really imagine our fascinating, complex
    and seemingly random world as created by a small
    set of relatively simple rules?
  • rough way nature emulation
  • they can give us an idea of how reasonable the
    thought of a world governed by simple rules is

4
Short History
  • CA were the invention of John von Neumann around
    1950 following a suggestion of Stan Ulam
  • von Neumann was looking for a model of
    computation that could act on its own matter

5
World Before CA
  • Before von Neumanns CA, the standard model of
    computation was the Turing machine
  • A Turing machine is a model of computation named
    after Alan Turing, a British mathematician who
    helped break the Germans Secret Enigma codes
    in WWII

6
Universal Turing Machines
Program (e.g., Microsoft Word)
Data (e.g., resignation letter)
No, theyre all just 0s and 1s!
7
Is CA Better than TM?
  • TM cannot alter themselves
  • TM cannot build other computers although they can
    simulate other TMs
  • Although TMs are a standard model of computation,
    they do not mirror the behavior of complex
    systems
  • Turing Machines do not have feedback mechanisms
    to alter their own behavior
  • A CA has the capability of altering itself it
    does not have a distinction between structural
    parts and data,
  • TM differs program and its data

8
Stephen Wolfram
  • Key CA researcher
  • Born in 1959 in London
  • First paper at age 15
  • Ph.D. at 20
  • Youngest recipient of MacArthur young genius
    award
  • Worked at Caltech and Princeton
  • Owner of Mathematica (Wolfram Research)
  • Fantastic publication record until
  • 1988 when he stopped publishing in scientific
    journals

9
CA decomposition
  • Domain
  • 1D row, ring
  • 2D rectangle, torus,
  • 3D volume
  • Cell domain element
  • Neighborhood
  • Cell state
  • Initial state (condition)
  • Cell program (rule)
  • Discrete time evolution

10
Most Simple CA
  • 1D binary row domain
  • Neighborhood cell itself

The first line is always given. This is what is
called the initial condition.

Line
This rule is trivial. It means black remains
black and grey remains grey.
Rule
This is how the Cellular Automaton evolves
Time 0

Time 1

Time 2

11
1D Binary Cellular Automata
  • 2 states
  • Neighborhood of 1 cell
  • 22 possible programs
  • No space dependence ? a bit boring
  • Neighborhood of 2 cells
  • elementary space dependence
  • 24 possible programs
  • Neighborhood of 3 cells
  • mostly used
  • Sufficient space dependence

12
Wolframs 1D Binary CA
  • Program example
  • Neighbourhood combnations
  • 28 possible rules (programs)










13
The Wolfram Nomenclature
  • Rule number ? ?0,255?
  • Example rule 90

Value 128
Value 64
Value 16
Value 32
281664 90
Value 1
Value 8
Value 4
Value 2
14
Rule 254
  • Rule
  • Initial condition
  • Applying the rule 254




15
Rule 254 Evolution

Time 0

Time 1

Time 2

Time 3
16
Rule 90
  • What does this form?
  • Initial condition


17
Guess the Pattern!









18
Rule 90 Evolution











19
9 Time Steps










20
Rule 90 Ad Infinitum
  • Sierpinski Gasket Pattern

21
Irregular Patterns?
  • Rule 30

22
Applying Rule 30










23
Rule 30 Evolution
24
Rule 30 Ad Infinitum
While one side has repetitive patterns, the other
side appears random.
25
Zoom of the Regular Region
26
Zoom of the Random Area
27
Other Rules
28
Rule Atlas (1)
29
Rule Atlas (2)
30
Rule Atlas (3)
  • 256 rules
  • Same initial condition

31
2D Cellular Automata
  • Torus domain

Right neighbour is left edge cell
Bottom neighbour is top edge cell
32
2D Binary CA
  • Domain torus bitmap
  • Neighbourhood
  • cell and its 4 (Von Neumann) or 8 neighbors
    (Moore)
  • 4-neighborhood used mostly
  • Program 25 binary vector
  • 232 possible programs (transition rules)

33
Well Known InstanceConways Game of Life
John H. Conway
34
Life Rules
  • Each step cell lives or dies
  • Alive Cell 1, Dead cell 0
  • Three simple rules
  • dies if of alive neighbour cells lt
    2 (loneliness)
  • dies if of alive neighbour cells gt 5
    (overcrowding)
  • lives is of alive neighbour cells 3
    (procreation)

35
Rule Examples
  • loneliness (dies if alive lt 2)
  • overcrowding (dies if alive gt 5)
  • procreation (lives if alive 3)

36
Life Patterns
37
Majority Rule
  • 1 if 5 or more Moore neighbours and self are 1,
  • 0 if 5 or more Moore neighbours and self are 0
  • Initial state white noise (50 zeroes)

?
38
Random Majority Rule
  • if 4 neighbours 0 and 4 1, new state random

?
39
Multistate 2D CA Patterns
40
The Segregation Model
  • Grid 500 by 500
  • 1500 agents, 1050 green, 450 red
  • 1000 vacant patches
  • Each agent has a tolerance
  • A green agent is happy when the ratio of greens
    to reds in its Moore neighbourhood is more than
    its tolerance
  • and vice versa for reds

41
Aggregation
  • Randomly allocate reds and greens to patches
  • With a tolerance of 40
  • An agent is happy when more than 3/8 ( 37.5)
    of its neighbours are of the same colour
  • Then the average number of neighbours of the same
    colour is 58 (about 5)
  • And about 18 of the agents are unhappy

42
Tipping
  • Unhappy agents move along a random walk to a
    patch where they are happy
  • Emergence is a result of tipping
  • If one red enters a neighbourhood with 2 reds
    already there, a previously happy green will
    become unhappy and move elsewhere, either
    contributing to a green cluster or possibly
    upsetting previously happy reds and so on

43
Emergence
  • Values of tolerance above 30 give clear display
    of clustering ghettos
  • Even though agents tolerate 30 of their
    neighbours being of the other colour in their
    neighbourhood, the average percentage of
    same-colour neighbours is typically 75 - 80
    after everyone has moved to a satisfactory
    location (risen from 58 before relocations)

44
Dynamic Social Impact
  • for individual a, impact of supporters, ias is

and the same for the impact of opposers, iao
agent a changes state if iao gt ias
45
Social Impact Patterns
Random starting attitudes, with 30 white
Final (stable) attitudes, with 16 white
46
More from the Game Theory
The Prisoners Dilemma
B co-operates (doesnt confess)
B defects (confesses)
3
5
A defects (confesses)
3
0
0
1
Length of time in prison
A co-operates (doesnt confess)
5
1
47
Playing the Game Once
  • The rational action is to confess, regardless of
    the others choice (obtaining a sentence of 3
    years rather than 5, or no prison rather than 1
    year).
  • Therefore both choose to confess, going to prison
    for 3 years, although if both refused to confess,
    they would both be sentenced to only 1 year in
    prison.

B co-operates (doesnt confess)
B defects (confesses)
3
5
A defects (confesses)
3
0
0
1
A co-operates (doesnt confess)
5
1
48
Iterated Prisoners Dilemma
  • If the same people repeatedly play the IPD game,
    they can learn the others strategy.
  • Whats the best strategy? Tit-for-Tat
  • 1st move cooperate
  • subsequent move copy opponents previous move
  • Tit-for-tat is best against other strategies,
    provided that there is no noise (perfect
    communication)
  • Note that this assumes that agents can recognise
    each other
  • Not a trivial requirement

49
Evolving strategies
  • 10002 agents arranged in a grid. At every step,
    each agent plays an IPD with a large random
    sample of other agents.
  • Each agent remembers the last three moves of its
    IPD opponent and follows one of the 215 possible
    different strategies
  • At the end of each step, an agent randomly finds
    another and switches to the other agents
    strategy if that is better (higher total payoff)
  • Calculation of difference between payoff is
    subject to noise
  • New strategies mutate (noisy transmission)

50
Lattice Gas Cellular Automata
  • Dynamics of boolean quantities on a regular
    lattice.
  • The evolution is synchronous and based on
    discrete time steps.

51
HPP Collision Rules
52
Evaluation of a LGCA
  • Realistic macroscopical fluid dynamics are
    obtained when the lattice is fine enough.
  • Problem averaging over big lattice domains
    needed.

53
From LGCA to LBM
Idea implement the dynamics directly on the
average values.
54
LGCA Examples
55
CA Binary Textures
  • Texture visualization of the CA state
  • NetLogo, StarLogo systems IDE for CA
  • General Language for CA?
  • Raw language Wolframs nomenclature
  • Most simple
  • torus domain
  • binary state
  • 4-neighborhood

56
Binary CA Programs
  • www.cg.tuwien.ac.at/studentwork/CESCG/CESCG-2000/P
    Borovsky
  • Cell 4 neigbours 5-bit neighborhood
  • Program 25 bits
  • How many such binary CA program there are?
  • 232 (4 294 967 296) possible programs

57
Random Program Generation
  • Program 32-bit number
  • Random generation
  • Initial state ?
  • white noise (statistical balance)
  • Patterns ?
  • Complex images
  • e.g. reaction-diffusion

58
Nice Pattern Recognition
  • Nearly 20 of random programs
  • ? interesting pattern
  • Characteristics of these programs ?
  • One possibility study of convergence
  • System repeating, if it repeats a sequence of
    states (after finite evolution)
  • Convergent system 1 state repetition

59
Convergence Determinition
  • Reverse pattern completing algorithm
  • Input program, output converges / not
  • Filling the space with the stable rules
  • Stable rule do not change the neighbourhood
  • Filling the space by 0 and 1 (substitution of
    ?)
  • Initial condition the final stable pattern

60
Randomness on any CA?
  • Binary automata 32-bit programs
  • CA Interpreter 32 cases in the neighborhood
  • More states for color textures
  • 256 states ? 240-bit programs
  • CA Interpreter too much cases in the
    neighborhood
  • Impossible to interpret the programs in the
    Wolframs format
  • Other language for CA?
  • Simple syntax
  • Easy to code
  • Easy to generate random programs

61
CA Language Proposal
  • Cell
  • State floating-point variable (color)
  • Multiple states (at least 6 states for
    reaction-diffusion)
  • Ability to read variables from 8 neighbors
  • Program
  • Set of rules for each variable
  • Evolution from time 0
  • Variable random (e.g. initial state)
  • CA extension
  • Cell knows its position (x,y), time,

62
Texture Language Proposal
63
TLA Program Example
  • Averaged Noise in TLA
  • Uses 1 variable
  • Rule conditional
  • Access of other cells lefti, righti,
  • Access of own cell centeri

64
TLA Interpreter
  • Slightly different conditional than in C/C
  • Never returns from nested branch
  • Visualization
  • Layers
  • Layer i variable i
  • Greyscale adaptive palette

65
TLA Usage
  • Noises
  • Reaction-diffusion
  • Implicit phenomena
  • Unsuitable
  • Explicit objects
  • e.g. midpoint diamond

66
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com