SY Lecture015.Cellular Automata
SY Lecture015.Cellular Automata
Automata
Example of a two-dimensional
automaton
Here is a 2-d model, with
256 cells, each cell in this
example can be in either (0
or 1) state,
State 1 is encoded with
color black, 0 with white.
Each cell has eight
neighbors (excluding
itself).
Examples of neighborhoods
Different models.
(A,B,C,D,E,F,X) are cells
Game of Life
Gas particles: Billiard-ball model
Ising model: Ferro-magnetic spins
Heat equation simulation
Percolation models
Wire models
Lattice Gas models
John H. Conway
transition
rules
T=0
T=1
(loneliness)
(overcrowding)
(procreation)
SOS - Lecture 4
overcrowding
procreation
(lives if #alive = 3)
?
!
Life - Patterns
Stable
block
pond
ship
eater
time = 3
time = 4
Periodic
time = 1
time = 2
Moving
Time = 1
time = 2
time = 5
SOS - Lecture 4
Now
1 second
later
1 0 1 1 0 1 0 0
H Q M S W E T G
1 dimensional
2 dimensional
G
A
X
N
O
W
R
I
M
J
E
Z
R
D
P
T
SOS - Lecture 4
SOS - Lecture 4
SOS - Lecture 4
CellularAutomata
Automata
- Neighborhood
Cellular
- Neighbourhood
A CA is an array of identically programmed automata, or cells,
which interact with one another in a neighborhood and have
definite state
Moore
neighborhood
Neumann
neighborhood
Cellular
Automata
Cellular
Automata
- States
SOS - Lecture 4
- States
Never infinite!
A
Z
26 possible states: A Z
G
A
X
N
O
W
R
I
M
J
E
Z
R
D
P
T
SOS - Lecture 4
10 11 12 13
The rules
time = 1
time = 2
time = 3
time = 4
time = 5
time = 6
time = 7
Initial
Step1
Step2
Here is an example
In this example, the initial configuration for all the cells is state
0, except for 4 cells in state 1.
The transition rule for this example, is :
a cell stays in state 1 (black), if it has two or three black
neighbors.
a cell changes to black, if it has exactly three black neighbors.
The next slide shows animation for this example
In this example:
Each cell has 8 neighbors,
Each cell can be in one possible value at any given time,
the transition takes place in discrete times
it helps to imagine a clock feeding all the cells.
Example of a Cellular
Automaton: VOTE
Vote is totalistic.
A totalistic rule updates a cell C by forming the
EightSum of the eight neighbors, adding in the value of
C itself to get the full NineSum, and then determining
the cell's new value strictly on the basis of where the
NineSum lies in the range of ten possibilities 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
Under a totalistic rule, a cell's next state depends only on
the total number of bits in its nine-cell neighborhood.
Let us present more detail of this example.
Oil&Water Simulation
(Bruce Boghosian, Boston Univ.)
http://physics.bu.edu/~bruceb/MolSim/
SOS - Lecture 4
SOS - Lecture 4
Surfactant Formation
(Bruce Boghosian, Boston Univ.)
Predator-prey
Herbivore-plant
Host-parasite/parasitoid
Host-Pathogen
SOS - Lecture 6
Predator-Prey (Lotka-Volterra)
SOS - Lecture 6
Predator-Prey - Basics
Applicable to other problems:
herbivore-plant
parasitoid-host
oscillations in the population size of both predator and
prey
peak of the predator's oscillation slightly behind the peak
of the prey's oscillation
SOS - Lecture 6
Predator-Prey - Formulas
SOS - Lecture 6
Predator-Prey - History
Population growth
Industrial
Evolution
Differential Equations
Biology
Mathematics
Lotka-Volterra
SOS - Lecture 6
Predator-Prey - Assumptions
population will grow exponentially when the predator is
absent
predator population will starve in the absence of the prey
population
predators can consume infinite quantities of prey
populations are moving randomly through a environment
SOS - Lecture 6
Predator-Prey - History
Alfred Lotka (american) and Vito Volterra (italian)
Volterra wanted to model the fish populations in the Adriatic Sea
Published his findings in Nature:
dP/dt = c0P - d0PR
dR/dt = c1R + d1PR
Received letter from Lotka about
previous similar publications of Lotka
himself
Developed model independently
SOS - Lecture 6
Predator-Prey (ideal)
SOS - Lecture 6
Huffaker (1958)
SOS - Lecture 6
Predator-Prey - Correct?
SOS - Lecture 6
Competition (true)
Consumer 1
Consumer 2
Resource
Top Consumer
Predator-prey simulation
Cellular Automata
http://www.stensland.net/java/erin.html
present
removed
+ or - ?
Web Spiders
Herbivorous
Arthropods
Plants
Lizards eat
spiders,
spiders eat
arthropods,
etc.
Less arthropods will
cause less or more
lizards?
Spiders
Insect herbivores
Plants
SOS - Lecture 4
Classification of Cellular
Automata
dimension
1D, 2D nD
1,2,, n
SOS - Lecture 4
Symmetric CAs
Spatial isotropic
Legal
Totalistic
Wolfram
SOS - Lecture 4
I.
II.
Periodic behavior
Cellular Cellular
Automata -Automata
Wolfram
SOS - Lecture 4
Steven Wolfram
0.0
0.1
II
0.2
0.3
IV
0.4
0.5
III
Cellular Cellular
Automata -Automata
Complexity -
SOS - Lecture 4
Complexity
SOS - Lecture 4
Cellular Cellular
Automata -Automata
Alive or not?
Alive or not?
SOS - Lecture 4
Data
(e.g., resignation letter)
Program
(e.g., Microsoft Word)
SOS - Lecture 4
SOS - Lecture 4
Self-Reproduction
Conway - Game of Life
Cellular Automata
Turing - Universal Machines
Self-reproduction
Self-Reproduction
An example of Self Reproducing
Cellular Automata
Self-Reproduction
Self Reproduction
Langton Loops
8 states
29 rules
SOS - Lecture 4
Summary
Summary
SOS - Lecture 4
Ulam
Universal Machines
Turing
Turing Machines
von Neumann
Conway
Game of Life
Langton
Self Reproduction
Sources
1. Seth Copen Goldstein, CMU
2. David E. Culler, UC. Berkeley,
3. [email protected]
4. Syeda Mohsina Afroze
and other students of Advanced Logic Synthesis, ECE 572,
1999 and 2000.
5. Russell Deaton, The University of Memphis
6. Nouraddin Alhagi, class 572
7. Schut, Vrije Universiteit, Amsterdam
Computers,
Life and
Complexity
http://ivytech7.cc.in.us/mathsci/complexity/life/index.htm
Allen Shotwell
Ivy Tech State College
Overview
Start Specific - Game of Life
Globalize - Cellular Automata
Speculate - Analogies and Stuff
History
The Rules
Manual Life
Computerized Life
Emergent Behavior
Parameter Effects
FOR MORE INFO...
http://www.reed.edu/~jwalton/gameoflife.html
The Rules
Each cell has eight possible neighbors (four on its sides,
four on its corners).
The rules for survival, death and birth are as follows:
death: if a live cell has less than two or more than three
live neighbors, it dies.
Manual Life
Try it
Computerized Life
Java - http://remus.rutgers.edu/~kenn/java/Life/
DOS ftp://ftp.cs.jhu.edu/pub/callahan/conways_life/life16.zi
p
X Windows ftp://ftp.cs.jhu.edu/pub/callahan/conways_life/xlife3.0.tar.gz
Windows 95 http://www.mindspring.com/~alanh/Life32/
Windows 3.1 ftp://ftp.cs.jhu.edu/pub/callahan/conways_life/wlife.zip
Emergent behavior
A. Simple Life Forms
B. The Glider
C. The Eater
D. Methuselahs
E. Glider Guns and Puffer Trains
F. Spaceships
FOR MORE INFO...
http://www.reed.edu/~jwalton/gameoflife.html
B. The Glider
The glider is a unique Life form.
Technically, it is a blinker, having a period of four.
However, it is not a stationary blinker, but one that
travels a single diagonal cell ever four generations.
If a glider is capable of escaping the milieu of a
changing pattern, it travels off into the distance
forever.
Cheshire:
Cheshire:
Generation
Generation1:
1:
Cheshire:
Cheshire:
Generation
Generation33
Cheshire:
Cheshire:
Generation
Generation88
and
andon
on
C. The Eater
The eater is a still-life that is remarkable for
it's capacity to devour gliders, provided that
the glider approaches it at a certain angle.
Eater:
Eater:
Generation
Generation11
Eater:
Eater:
Generation
Generation16
16
Eater:
Eater:
Generation
Generation22
22
Eater:
Eater:
Generation
Generation48
48
D. Methuselahs
Methuselahs are initial patterns of live cells that require
a large number of generations to stabilize.
The smallest and perhaps most famous methuselah is
the R-pentomino which takes 1103 generations before
it reaches a stable (periodic) state.
The acorn is perhaps the longest lived methuselah
known, requiring over 5000 generations to reach
periodicity.
R-pentomino
R-pentomino
Generation
Generation11: :
Puffer
PufferTrain:
Train:
Generation
Generation11
Puffer
PufferTrain:
Train:
Generation
Generation54
54
F. Spaceships
A spaceship is a finite pattern of live cells in Life that after a certain
number of generations reappears, but translated in some direction by a
nonzero distance.
Translation is measured by the shortest king-wise connected path
between two cells.
So two cells adjacent to each other are one cell apart, whether or not
the cells are adjacent orthogonally or diagonally.
The process of translating after a certain number of generations is
called moving or traveling.
The number of generations before the pattern reappears (but translated)
is called the period of the spaceship.
(This is analogous to the period of stationary oscillators.)
F. Spaceships (Cont)
Many spaceships appear to be the same pattern after a number of
generations,
but on closer examination are not really the same.
Example
ExampleSpace
Space
Ship:
Ship:
Generation
Generation11
Example
Example
Spaceship:
Spaceship:
Generation
Generation55
http://www.cs.jhu.edu/~callahan/lexiconf.htm
Cellular Automata
Extension of Life
Different Rules
Varying Dimensions
FOR MORE INFO...
http://alife.santafe.edu/alife/topics/cas/ca-faq/ca-faq.html
Analysis of Emergence in CA
Wolframs Classification
Mean Field Theory
Parameter
Hollands CGP
FOR MORE INFO...
http://www.santafe.edu/~hag/complex1/complex1.html
Wolframs Classifications
Four Classifications
Class I Very Dull
Class II Dull
Class III Interesting
Class IV Very Interesting
http://alife.santafe.edu/alife/topics/cas/ca-faq/classify/classify.html
S. Wolfram, Statistical Mechanics of CA, Rev. Mod. Phys. 55:601-644 (1983)
Class II Dull
All configurations map to
simple, separated periodic
structures
Parameter
Measure of the distribution of state transitions
(alive to dead/dead to alive)
Fraction of the rule table containing
neighborhoods with nonzero transitions.
Low , low Wolfram class
High , higher Wolfram class
Works bests in the limit of infinite number of
states.
Hollands CGP
Constrained Generating Procedures - models
Rules that are simple can generate emergent behavior
Emergence centers on interactions that are more than the
summing of independent activities
Persistent emergent phenomena can serve as components
of more complex emergent phenomena
FOR MORE INFO...
CA as Turing Machines
Glider Guns as Logic Gates
Universal Turing Machines
http://cgi.student.nada.kth.se/cgi-bin/d95-aeh/get/umeng
BIT REPRESENTATION
NOT Gate
AND GATE
NAND GATE
UNIVERSAL GATE
BASIC DIGITAL CIRCUITS
BIT REPRESENTATION
The Glider can be used to represent a 1
The absence of a Glider can be used to
represent a 0
A string of Gliders with equal spacing is a
binary number.
Artificial Life
Artificial Life ("AL" or "Alife") is the name given to a
new discipline that studies "natural" life by attempting
to recreate biological phenomena from scratch within
computers and other "artificial" media.
Alife complements the traditional analytic approach of
traditional biology with a synthetic approach in
which, rather than studying biological phenomena by
taking apart living organisms to see how they work,
one attempts to put together systems that behave like
living organisms.
Simulators
The phrase Artificial Life is somewhat allencompassing including things such as:
artificial intelligence,
simulation of natural life,
etc.
Fundamental Algorithms of
ALife Simulation
Artificial life simulation can be subdivided
into categories based on the algorithm used.
The subdivisions are
Neural Networks
Evolutionary Algorithms
Cellular Automata
Neural Networks
Input-output neurons organized into highly
connected networks.
Used for higher-order processes such as
learning.
(Brain Model)
Evolutionary Algorithms
Iterative algorithms that contain a population of
individuals that compete. Each iteration
produces survivors who compete the best.
There are several methods.
Genetic Algorithm
Genetic Programming
Evolutionary Programming
Classifier Systems
Lindenmeyer Systems
Genetic Algorithm
By J. Holland.
A population of individuals is chosen at random.
The fitness of the individuals is determined
through a defined function.
Fit individuals are kept and unfit ones are not.
The new population undergoes the process.
Individuals are in practice arrays of bits or
characters.
Genetic Programming
Similar to the GA except the individuals are
computer programs in a lisp environment.
Evolutionary Programming
Start with a random population.
Mutate the individuals to produce the new
population.
Assess fitness of offspring (new population)
Classifier Systems
J. Holland. Early application of Gas.
CFSs use evolutionary algorithm to adapt their behavior toward a
changing ENVIRONMENT.
Holland envisioned a cognitive system capable of classifying the
goings on in its ENVIRONMENT, and then reacting to these
goings on appropriately.
So what is needed to build such a system? Obviously, we need
(1) an environment;
(2) receptors that tell our system about the goings on;
(3) effectors, that let our system manipulate its environment; and
(4) the system itself, conveniently a "black box" in this first approach, that has
(2) and (3) attached to it, and "lives" in (1).
Lindenmeyer Systems
A system of rules used to model growth and
development of organisms.
Cellular Automata
Discrete system of cells that iterate based a set
of rules (game of Life, etc)
A Life Simulations
Many Simulations based on the algorithms described
have been produced.
These Simulations can be divided into two types.
Simulation of a particular life form using one or
more algorithms, and Instantiation of artificial life
(or the bottom-up approach).
Simulation
Examples of simulations of life forms include
ANTS
BOIDS
Gene Pool
Biotopia
ANTS
Simulation of Ant behavior using a CA where each cell is
either a left or right turn.
Ants move through the cells following the turn commands
and changing the value of the cell to its opposite.
Instead of attempting to represent a living organism or
process, natural laws are invoked in an artificial
biosphere.
Tom Rays Tierra is an example.
Avida is another.
BOIDS
Each boid has direct access to the whole scene's geometric
description, but reacts only to flockmates within a certain small
radius of itself.
The basic flocking model consists of three simple steering
behaviors:
1.Separation: steer to avoid crowding local flockmates.
2.Alignment: steer towards the average heading of local
flockmates.
3.Cohesion: steer to move toward the average position of local
flockmates.
BOIDS - Cont.
In addition, the more elaborate behavioral model
included predictive obstacle avoidance and goal
seeking.
Obstacle avoidance allowed the boids to fly through
simulated environments while dodging static objects.
For applications in computer animation, a low priority
goal seeking behavior caused the flock to follow a
scripted path.
Gene Pool
Uses a genetic algorithm for animation of
creatures based on a response to a stimulus.
In the gene pool, creatures try to reproduce
by contacting other creatures.
Those creatures who move around better
contact more of their fellow creatures and
reproduce more.
Biotopia
Similar to Gene Pool except creatures thrive on their
ability to find food.
If they dont find enough, they lose energy and
die.
They reproduce by finding life cells which they
collect until they have enough to produce
offspring.
Instantiation (bottom-up
approach)
Instead of attempting to represent a living
organism or process, natural laws are
invoked in an artificial biosphere.
Tom Rays Tierra is an example.
Avida is another.
Tierra
Organisms in Tierra are machine-language
programs.
The organism/program is executed by moving
through its list of instructions.
Instructions in an organism may be altered
through mutation or swapping instructions with
other organisms and the organism will still be
executable.
Tierra - cont.
There are 32 instructions available. Each is
specified by a 5 bit number (any possible 5
bit number is therefore valid). Mutation can
be caused by flipping a bit.
Tierra - cont.
The Tierra system sets up a virtual computer
with a CPU and memory. Organisms use the
CPU to execute their instructions and reside
in portions of the memory.
Tierra - cont.
The process normally starts with a single
organism which is self reproducing. It is
executed over and over producing copies of
itself which are stored in the memory. The
Tierra user introduces mutations in some of
offspring.
Tierra - cont.
Most mutations produce organisms that dont
reproduce at all. However, occasionally,
mutations produce organisms that are better
at reproduction.
Tierra - cont.
When the memory of the virtual computer is
full, some organisms must be removed. The
system removes organisms based on how
well the work. For example, it is possible to
define error conditions for certain
executions and remove those organisms that
produce errors.
Resources
On Modeling Life, Chris Adami
http://xxx.lanl.gov/abs/adap-org/9405002